Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Scheduler cannot remove own expired lock in case of certain MongoDB client exceptions #196

Closed
zero-devourer opened this issue Jun 15, 2020 · 1 comment

Comments

@zero-devourer
Copy link

DESC:
When expire the lock , mongo has a exception (such as connection time out) . Then the lock cannot be expired. And this job will no longer be triggered.
REASON:
the code in ExpiryCalculator.class
`
public boolean isTriggerLockExpired(Document lock) {
String schedulerId = lock.getString(Constants.LOCK_INSTANCE_ID);
return isLockExpired(lock, triggerTimeoutMillis) && hasDefunctScheduler(schedulerId);
}

private boolean hasDefunctScheduler(String schedulerId) {
Scheduler scheduler = schedulerDao.findInstance(schedulerId);
if (scheduler == null) {
log.debug("No such scheduler: {}", schedulerId);
return false;
}
return scheduler.isDefunct(clock.millis()) && schedulerDao.isNotSelf(scheduler);
}
If scheduler is not defunct ,the function (isTriggerLockExpired())s result will always be false. And the job which was locked will nerver be triggered.

@zero-devourer zero-devourer changed the title Scheduler cannot remove itself expired lock。 Scheduler cannot remove own expired lock。 Jun 15, 2020
@michaelklishin
Copy link
Owner

@zero-devourer please submit a PR since you understand the problem.

@michaelklishin michaelklishin changed the title Scheduler cannot remove own expired lock。 Scheduler cannot remove own expired lock in case of certain MongoDB client exceptions Jul 14, 2020
arulrajnet added a commit to arulrajnet/quartz-mongodb that referenced this issue Jul 23, 2020
arulrajnet added a commit to arulrajnet/quartz-mongodb that referenced this issue Jul 24, 2020
- Change the isTriggerLockExpired to as like isJobLockExpired
- unit test fixes
NourNuxeo pushed a commit to nuxeo/quartz-mongodb that referenced this issue May 11, 2022
- Change the isTriggerLockExpired to as like isJobLockExpired
- unit test fixes
NourNuxeo pushed a commit to nuxeo/quartz-mongodb that referenced this issue May 11, 2022
- Change the isTriggerLockExpired to as like isJobLockExpired
- unit test fixes
NourNuxeo pushed a commit to nuxeo/quartz-mongodb that referenced this issue May 12, 2022
- Change the isTriggerLockExpired to as like isJobLockExpired
- unit test fixes
NourNuxeo pushed a commit to nuxeo/quartz-mongodb that referenced this issue May 12, 2022
- Change the isTriggerLockExpired to as like isJobLockExpired
- unit test fixes
ataillefer pushed a commit to nuxeo/quartz-mongodb that referenced this issue May 12, 2022
- Change the isTriggerLockExpired to as like isJobLockExpired
- unit test fixes
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants