Repository navigation
Conversation
…penIntegrationEngine#571) PollConnector.stop() shuts its Quartz scheduler down, but halt() only interrupted the running job. StdSchedulerFactory keeps a running scheduler under its instance name, which is the channel ID, so the next deploy of the same channel got the old scheduler back with the poll job still stored, and start() failed with ObjectAlreadyExistsException. halt() now also calls scheduler.shutdown(false), which does not wait for the interrupted job. Adds PollConnectorHaltTest; the halt case fails with the reported exception without this change. Signed-off-by: iacsha <122627209+iacsha@users.noreply.github.com>
pacmano1
left a comment
There was a problem hiding this comment.
Ran the issue's REST repro on engines built from main and from this branch, on Derby. Main: deploying after Halt returns 500 with the ObjectAlreadyExistsException. This branch: deploys and polls again. Same for the File Reader and the Database Reader, and for Halt then Start without undeploying, which also failed on main. Halting in the middle of a long poll works too. A poll that ignores the interrupt keeps running, but it delivers nothing once the channel is redeployed.
Optional: a third test calling start() on the same connector after halt() would cover the Halt then Start path.
Co-authored with Claude Code.
…e#571) Signed-off-by: iacsha <122627209+iacsha@users.noreply.github.com>
|
Thanks for testing it end to end. Added the third test in d41fcba: |
Fixes #571.
Problem
After a polling channel is halted and undeployed, deploying it again on the same engine returns HTTP 500:
PollConnectorJobHandlercreates the Quartz scheduler withStdSchedulerFactoryand setsorg.quartz.scheduler.instanceNameto the channel ID. The factory keeps a running scheduler in itsSchedulerRepositoryunder that name until it is shut down.PollConnector.stop()shuts it down, buthalt()only callsscheduler.interrupt(job.getKey()). So after a halt, the next deploy'sfactory.getScheduler()gets the old scheduler back with the poll job still stored, andscheduleJobfails.Fix
halt()now also callsscheduler.shutdown(false)after interrupting the job.falsemeans it doesn't wait for the interrupted job to finish, so a halt stays immediate.stop()is unchanged.Tests
New
PollConnectorHaltTest:PollConnectoris started and halted, then a new connector for the same channel ID is started.The halt case fails without this change with the exact exception above. With it, both pass.
:donkey:testand:server:testare green.I haven't rerun the REST repro from the issue against a built engine. The unit test exercises the same start → halt → start path through the same
StdSchedulerFactoryrepository.