|
|
|
@ -673,11 +673,11 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
|
|
|
|
|
this.schedSignaler = signaler; |
|
|
|
|
|
|
|
|
|
// If the user hasn't specified an explicit lock handler, then
|
|
|
|
|
// If the user hasn't specified an explicit lock handler, then
|
|
|
|
|
// choose one based on CMT/Clustered/UseDBLocks.
|
|
|
|
|
if (getLockHandler() == null) { |
|
|
|
|
|
|
|
|
|
// If the user hasn't specified an explicit lock handler,
|
|
|
|
|
// If the user hasn't specified an explicit lock handler,
|
|
|
|
|
// then we *must* use DB locks with clustering
|
|
|
|
|
if (isClustered()) { |
|
|
|
|
setUseDBLocks(true); |
|
|
|
@ -987,8 +987,8 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
|
|
|
|
|
List<TriggerKey> misfiredTriggers = new LinkedList<TriggerKey>(); |
|
|
|
|
long earliestNewTime = Long.MAX_VALUE; |
|
|
|
|
// We must still look for the MISFIRED state in case triggers were left
|
|
|
|
|
// in this state when upgrading to this version that does not support it.
|
|
|
|
|
// We must still look for the MISFIRED state in case triggers were left
|
|
|
|
|
// in this state when upgrading to this version that does not support it.
|
|
|
|
|
boolean hasMoreMisfiredTriggers = |
|
|
|
|
getDelegate().hasMisfiredTriggersInState( |
|
|
|
|
conn, STATE_WAITING, getMisfireTime(), |
|
|
|
@ -2835,12 +2835,10 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
currentLoopCount++; |
|
|
|
|
try { |
|
|
|
|
long misfireTime = getMisfireTime(); |
|
|
|
|
List<TriggerKey> waitingKeys = getDelegate().selectTriggerToAcquire(conn, noLaterThan + timeWindow, misfireTime, maxCount); |
|
|
|
|
List<TriggerKey> appointKeys = getDelegate().selectAppointTriggerToAcquire(conn, noLaterThan + timeWindow, misfireTime, maxCount, this.currentId); |
|
|
|
|
List<TriggerKey> appointKeys = getDelegate().selectAppointOrNonTriggerToAcquire(conn, noLaterThan + timeWindow, misfireTime, maxCount, this.currentId); |
|
|
|
|
List<TriggerKey> allKeys = new ArrayList<TriggerKey>(); |
|
|
|
|
Set<String> keyIds = new HashSet<String>(); |
|
|
|
|
|
|
|
|
|
mergeKeys(allKeys, keyIds, waitingKeys); |
|
|
|
|
mergeKeys(allKeys, keyIds, appointKeys); |
|
|
|
|
|
|
|
|
|
// No trigger is ready to fire yet.
|
|
|
|
@ -3117,7 +3115,7 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
try { |
|
|
|
|
if (triggerInstCode == CompletedExecutionInstruction.DELETE_TRIGGER) { |
|
|
|
|
if (trigger.getNextFireTime() == null) { |
|
|
|
|
// double check for possible reschedule within job
|
|
|
|
|
// double check for possible reschedule within job
|
|
|
|
|
// execution, which would cancel the need to delete...
|
|
|
|
|
TriggerStatus stat = getDelegate().selectTriggerStatus( |
|
|
|
|
conn, trigger.getKey()); |
|
|
|
@ -3236,7 +3234,7 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
try { |
|
|
|
|
RecoverMisfiredJobsResult result = RecoverMisfiredJobsResult.NO_OP; |
|
|
|
|
|
|
|
|
|
// Before we make the potentially expensive call to acquire the
|
|
|
|
|
// Before we make the potentially expensive call to acquire the
|
|
|
|
|
// trigger lock, peek ahead to see if it is likely we would find
|
|
|
|
|
// misfired triggers requiring recovery.
|
|
|
|
|
int misfireCount = (getDoubleCheckLockMisfireHandler()) ? |
|
|
|
@ -3311,8 +3309,8 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
|
|
|
|
|
Connection conn = getNonManagedTXConnection(); |
|
|
|
|
try { |
|
|
|
|
// Other than the first time, always checkin first to make sure there is
|
|
|
|
|
// work to be done before we acquire the lock (since that is expensive,
|
|
|
|
|
// Other than the first time, always checkin first to make sure there is
|
|
|
|
|
// work to be done before we acquire the lock (since that is expensive,
|
|
|
|
|
// and is almost never necessary). This must be done in a separate
|
|
|
|
|
// transaction to prevent a deadlock under recovery conditions.
|
|
|
|
|
List<SchedulerStateRecord> failedRecords = null; |
|
|
|
@ -3325,7 +3323,7 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
getLockHandler().obtainLock(conn, LOCK_STATE_ACCESS); |
|
|
|
|
transStateOwner = true; |
|
|
|
|
|
|
|
|
|
// Now that we own the lock, make sure we still have work to do.
|
|
|
|
|
// Now that we own the lock, make sure we still have work to do.
|
|
|
|
|
// The first time through, we also need to make sure we update/create our state record
|
|
|
|
|
failedRecords = (firstCheckIn) ? clusterCheckIn(conn) : findFailedInstances(conn); |
|
|
|
|
|
|
|
|
@ -3838,7 +3836,7 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
Connection conn = null; |
|
|
|
|
try { |
|
|
|
|
if (lockName != null) { |
|
|
|
|
// If we aren't using db locks, then delay getting DB connection
|
|
|
|
|
// If we aren't using db locks, then delay getting DB connection
|
|
|
|
|
// until after acquiring the lock since it isn't needed.
|
|
|
|
|
if (getLockHandler().requiresConnection()) { |
|
|
|
|
conn = getNonManagedTXConnection(); |
|
|
|
@ -4047,6 +4045,4 @@ public abstract class JobStoreSupport implements JobStore, Constants {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// EOF
|
|
|
|
|
} |