← Back to Pull requests

Release the poll scheduler on halt so the channel can redeploy (fixes #571) #574

Open
unknown opened this pull request with 210 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 12, 2026 13:42 UTC
Author

Fixes #571.

Problem

After a polling channel is halted and undeployed, deploying it again on the same engine returns HTTP 500:

Caused by: com.mirth.connect.donkey.server.ConnectorTaskException: org.quartz.ObjectAlreadyExistsException: Unable to store Job : '<channelId>.PollConnector<channelId>', because one already exists with this identification.
	at com.mirth.connect.donkey.server.channel.PollConnector.start(PollConnector.java:44)

PollConnectorJobHandler creates the Quartz scheduler with StdSchedulerFactory and sets org.quartz.scheduler.instanceName to the channel ID. The factory keeps a running scheduler in its SchedulerRepository under that name until it is shut down. PollConnector.stop() shuts it down, but halt() only calls scheduler.interrupt(job.getKey()). So after a halt, the next deploy's factory.getScheduler() gets the old scheduler back with the poll job still stored, and scheduleJob fails.

Fix

halt() now also calls scheduler.shutdown(false) after interrupting the job. false means it doesn't wait for the interrupted job to finish, so a halt stays immediate. stop() is unchanged.

Tests

New PollConnectorHaltTest:

  • A minimal PollConnector is started and halted, then a new connector for the same channel ID is started.

  • The same sequence with stop instead of halt, as a control.
  • The halt case fails without this change with the exact exception above. With it, both pass. :donkey:test and :server:test are 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 StdSchedulerFactory repository.

    Diff: 210 lines (+157 / -53) across 2 files Reviewer: pacmano1 Review duration: 26088m
    All Vouch review confidence checks passed
    Residual risk 0.32 = Change Risk (0.60) × (1 − Review Confidence (0.47)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.60 · 210 lines diff across 2 files
    0.60
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.02 · 1 substantive comment(s)
    0.02
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    46%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Shallow Review Depth shallow_review_depth
    0.344
    Diff Size diff_size
    0.320
    Sensitive Paths sensitive_paths
    0.060
    Real PR Conversation Timeline
    1 comments
    "Review active on #574"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 46.7% reviewed sensitive_module
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 59.7% (MEDIUM) · Higher = larger blast radius
    59.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 46.7% · Lower = rushed or shallow review
    46.7%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 31.8% · Safe to merge
    31.8%