Skip to content

fix #1349, JobInterruptMonitorPlugin memory leak and concurrency issues - #1470

Open
e210 wants to merge 1 commit into
quartz-scheduler:mainfrom
e210:fix/1349-job-interrupt-monitor-memory-leak
Open

fix #1349, JobInterruptMonitorPlugin memory leak and concurrency issues#1470
e210 wants to merge 1 commit into
quartz-scheduler:mainfrom
e210:fix/1349-job-interrupt-monitor-memory-leak

Conversation

@e210

@e210 e210 commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

This PR fixes three bugs in JobInterruptMonitorPlugin as reported in #1349.

Fixes issue #1349

Changes

  • Set setRemoveOnCancelPolicy(true) on ScheduledThreadPoolExecutor so cancelled tasks are immediately removed from the work queue, preventing memory leaks
  • Replaced the single ScheduledFuture field with a ConcurrentHashMap<String, ScheduledFuture> keyed by fireInstanceId, so concurrent jobs no longer overwrite each
    other's monitor
  • Changed getJobDetail().getJobDataMap() to getMergedJobDataMap() so that AutoInterruptable and MaxRunTime can be configured on the trigger as well as the job
  • Fixed debug log to report the actual delay used instead of always logging the default value

Checklist

  • tested locally
  • updated the docs
  • added appropriate test
  • signed-off on the DCO referenced in the CONTRIBUTING link below via git commit -s on my commits, and submit this code under terms of the Apache 2.0 license and
    assign copyright to the Quartz project owners

In submitting this contribution, I agree to the terms of contributing as referred to here:
https://github.com/quartz-scheduler/contributing/blob/main/CONTRIBUTING.md

@melloware melloware linked an issue Feb 17, 2026 that may be closed by this pull request
@melloware melloware added the is:bug Bugs to fix label Feb 17, 2026

@melloware melloware left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR

…concurrency issues

Signed-off-by: Ezio Caffi <ezio.caffi@gmail.com>
@e210
e210 force-pushed the fix/1349-job-interrupt-monitor-memory-leak branch from 10f3b1d to ba74cdd Compare August 3, 2026 07:16
@e210

e210 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto latest main (9294eac4) and force-pushed — the diff is unchanged from the version you approved, only the base commit moved.

The earlier red build wasn't caused by this PR: every build in that window failed (#1455, #1466#1469 as well) and the pipeline recovered on its own by Feb 23. All checks are green now.

@melloware this one has been sitting since February — anything else needed from my side?

@melloware

Copy link
Copy Markdown
Contributor

No it looks good. I don't have commit permissions only review and tagging permissions. Only @jhouserizer can merge PRs

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

Labels

is:bug Bugs to fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JobInterruptMonitorPlugin can cause memory leaks

2 participants