Skip to content

A halted polling channel cannot be deployed again on the same engine #571

Open

Description

@pacmano1

After a polling channel is halted and undeployed, deploying it again on the same engine fails.

On 4.7.0, a fresh engine on Derby with nothing added:

  1. A channel with a JavaScript Reader source (return 'tick';, polling every second) and a JavaScript Writer destination.
  2. Deploy it. It polls.
  3. Halt it: POST /api/channels/{id}/_halt (204).
  4. Undeploy it (204).
  5. Deploy it again: HTTP 500.
com.mirth.connect.donkey.server.StartException: Failed to start channel repro poller halt (06930d83-12e6-42a0-b050-649473a03705).
	at com.mirth.connect.donkey.server.channel.Channel.start(Channel.java:792)
	at com.mirth.connect.server.controllers.DonkeyEngineController$DeployTask.doDeploy(DonkeyEngineController.java:2036)
	...
Caused by: com.mirth.connect.donkey.server.ConnectorTaskException: org.quartz.ObjectAlreadyExistsException: Unable to store Job : '06930d83-12e6-42a0-b050-649473a03705.PollConnector06930d83-12e6-42a0-b050-649473a03705', because one already exists with this identification.
	at com.mirth.connect.donkey.server.channel.PollConnector.start(PollConnector.java:44)

With Stop instead of Halt in step 3, the deploy in step 5 works and the channel polls again.

PollConnector.stop() shuts the poller's Quartz scheduler down (scheduler.shutdown(true)). PollConnector.halt() only interrupts the running job (scheduler.interrupt(job.getKey())), so the job is still registered when the channel is deployed again. Measured with a JavaScript Reader; the File Reader and the Database Reader use the same PollConnector. Shutting the scheduler down at the end of halt, as stop does, looks like the fix; not tested.

Co-authored with Claude Code.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions