/** * Take action when the job timer times out. * * @exception IOException Thrown if an I/O error occurred. */ private void jobTimeout() throws IOException { boolean doExit = false; synchronized (this) { if (myJobTimer.isTriggered()) { continueRun = false; if (myState == State.RUNNING) { myState = State.TERMINATE_CANCEL_JOB; myCancelMessage = "Job exceeded maximum running time"; System.err.println(myCancelMessage); doExit = true; } } } // Cannot hold the synchronization lock while calling System.exit(), // otherwise a deadlock can occur between this thread (the timer thread) // and the shutdown hook thread. if (doExit) System.exit(1); }
/** * Take action when the Job Scheduler's lease renewal timer times out. * * @exception IOException Thrown if an I/O error occurred. */ private synchronized void schedulerRenewTimeout() throws IOException { if (mySchedulerRenewTimer.isTriggered()) { myJobScheduler.renewLease(this); } }