JobInterruptMonitorPlugin can cause memory leaks
JobInterruptMonitorPlugin can cause memory leaks due to the fact stated in java docs for ScheduledThreadPoolExecutor
When a submitted task is cancelled before it is run, execution is suppressed. By default, such a cancelled task is not automatically removed from the work queue until its delay elapses. While this enables further inspection and monitoring, it may also cause unbounded retention of cancelled tasks. To avoid this, use setRemoveOnCancelPolicy(boolean) to cause tasks to be immediately removed from the work queue at time of cancellation.
I believe it should be initialised this way:
this.executor = Executors.newScheduledThreadPool(1);
((ScheduledThreadPoolExecutor) this.executor).setRemoveOnCancelPolicy(true);If all triggers share the same monitor instance then why only private ScheduledFuture future; is kept? Why not Map<JobKey, ScheduledFuture> ?
Other thing I've noticed that
context.getJobDetail().getJobDataMap()is used instead of recommended
context.getMergedJobDataMap()Source: quartz-scheduler/quartz