parent
d1f9c94038
commit
5f74396bfb
|
@ -0,0 +1,6 @@
|
||||||
|
---
|
||||||
|
type: fix
|
||||||
|
issue: 4617
|
||||||
|
title: "Previously, Quartz jobs were scheduled after the scheduler was started which resulted in a race
|
||||||
|
condition where duplicate `TRIGGER_ACCESS` entries were being added to the `QRTZ_LOCKS` table.
|
||||||
|
This has been fixed."
|
|
@ -145,6 +145,14 @@ public abstract class BaseSchedulerServiceImpl implements ISchedulerService {
|
||||||
|
|
||||||
@EventListener(ContextRefreshedEvent.class)
|
@EventListener(ContextRefreshedEvent.class)
|
||||||
public void start() {
|
public void start() {
|
||||||
|
|
||||||
|
// Jobs are scheduled first to avoid a race condition that occurs if jobs are scheduled
|
||||||
|
// after the scheduler starts for the first time. This race condition results in duplicate
|
||||||
|
// TRIGGER_ACCESS entries being added to the QRTZ_LOCKS table.
|
||||||
|
// Note - Scheduling jobs before the scheduler has started is supported by Quartz
|
||||||
|
// http://www.quartz-scheduler.org/documentation/quartz-2.3.0/cookbook/CreateScheduler.html
|
||||||
|
scheduleJobs();
|
||||||
|
|
||||||
myStopping.set(false);
|
myStopping.set(false);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -159,8 +167,6 @@ public abstract class BaseSchedulerServiceImpl implements ISchedulerService {
|
||||||
ourLog.error("Failed to start scheduler", e);
|
ourLog.error("Failed to start scheduler", e);
|
||||||
throw new ConfigurationException(Msg.code(1632) + "Failed to start scheduler", e);
|
throw new ConfigurationException(Msg.code(1632) + "Failed to start scheduler", e);
|
||||||
}
|
}
|
||||||
|
|
||||||
scheduleJobs();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void scheduleJobs() {
|
private void scheduleJobs() {
|
||||||
|
|
Loading…
Reference in New Issue