agave-jobs/jobs-core/src/main/java/org/iplantc/service/jobs/managers/JobManager.java
/**
     * Looks for the job in the currently active quartz jobs for each job phase
     * and interrupts the job if present.
     *
     * @param lockedJob the job for which to release the lock
     * @return true if the job was interrupted, false otherwise;
     */
Looks for the job in the currently active quartz jobs for each job phase
and interrupts the job if present.

@param lockedJob the job for which to release the lock
@return true if the job was interrupted, false otherwise.
Looks for the job in the currently active quartz jobs for each job phase and interrupts the job if present . @param lockedJob the job for which to release the lock @return true if the job was interrupted false otherwise .
public static boolean releaseLocalJobLock(Job lockedJob) {
        StdSchedulerFactory factory = new org.quartz.impl.StdSchedulerFactory();
        try {
            for (Scheduler scheduler : factory.getAllSchedulers()) {
                List<JobExecutionContext> currentJobs = scheduler.getCurrentlyExecutingJobs();
                if (currentJobs != null) {
                    for (JobExecutionContext context : currentJobs) {
                        if (context.getMergedJobDataMap().containsKey("uuid") &&
                                StringUtils.equals(lockedJob.getUuid(), context.getMergedJobDataMap().getString("uuid"))) {
                            try {
                                log.debug("Found worker " + context.getJobDetail().getKey().getName() +
                                        " in the " + scheduler.getSchedulerName() + " processing job " +
                                        lockedJob.getUuid() + ". Attempting to interrupt job.");
                                scheduler.interrupt(context.getJobDetail().getKey());
                                log.debug("Interrupted the worker currently processing job " + lockedJob.getUuid());
                            } catch (Exception e) {
                                log.error("Failed to interrupt the worker running job " + lockedJob.getUuid(), e);
                            }
                            return true;
                        }
                    }
                }
            }
            log.debug("No worker found processing job " + lockedJob.getUuid() + ". Releasing local lock on the job.");
        } catch (SchedulerException e) {
            log.error("Failed to query container quartz schedulers for job prior to rollback. " +
                    "No existing worker currently processing job " + lockedJob.getUuid() +
                    " will be interrupted. This may lead to temporary concurrency conflicts. " +
                    "If in doubt, restart this container.", e);
        } finally {
            log.debug("Releasing local lock on job " + lockedJob.getUuid() + " after interrupt.");
            AbstractJobProducerFactory.releaseJob(lockedJob.getUuid());
        }
        return false;
    }
public static boolean releaseLocalJobLock ( Job lockedJob ) { StdSchedulerFactory factory = new org . quartz . impl . StdSchedulerFactory ( ) ; try { for ( Scheduler scheduler : factory . getAllSchedulers ( ) ) { List < JobExecutionContext > currentJobs = scheduler . getCurrentlyExecutingJobs ( ) ; if ( currentJobs != null ) { for ( JobExecutionContext context : currentJobs ) { if ( context . getMergedJobDataMap ( ) . containsKey ( "uuid" ) && StringUtils . equals ( lockedJob . getUuid ( ) , context . getMergedJobDataMap ( ) . getString ( "uuid" ) ) ) { try { log . debug ( "Found worker " + context . getJobDetail ( ) . getKey ( ) . getName ( ) + " in the " + scheduler . getSchedulerName ( ) + " processing job " + lockedJob . getUuid ( ) + ". Attempting to interrupt job." ) ; scheduler . interrupt ( context . getJobDetail ( ) . getKey ( ) ) ; log . debug ( "Interrupted the worker currently processing job " + lockedJob . getUuid ( ) ) ; } catch ( Exception e ) { log . error ( "Failed to interrupt the worker running job " + lockedJob . getUuid ( ) , e ) ; } return true ; } } } } log . debug ( "No worker found processing job " + lockedJob . getUuid ( ) + ". Releasing local lock on the job." ) ; } catch ( SchedulerException e ) { log . error ( "Failed to query container quartz schedulers for job prior to rollback. " + "No existing worker currently processing job " + lockedJob . getUuid ( ) + " will be interrupted. This may lead to temporary concurrency conflicts. " + "If in doubt, restart this container." , e ) ; } finally { log . debug ( "Releasing local lock on job " + lockedJob . getUuid ( ) + " after interrupt." ) ; AbstractJobProducerFactory . releaseJob ( lockedJob . getUuid ( ) ) ; } return false ; }
Looks for the job in the currently active quartz jobs for each job phase
 and interrupts the job if present.
Looks for the job in the currently active quartz jobs for each job phase and interrupts the job if present .
// loop through all schedulers looking for one processing the current job