/** * handle timeout response by escalating it to a failure */ @Override public void run() { try { synchronized (processTerminated) { if (!processTerminated.get()) { processTerminated.wait(executionTimeout); } } } catch (InterruptedException e) { //assume signalled; exit } //check the status; if the marker isn't true, bail if (!processTerminated.getAndSet(true)) { LOG.info("process timeout: reporting error code {}", timeoutCode); //timeout if (isInState(STATE.STARTED)) { //trigger a failure stopForkedProcess(); } reportFailure(timeoutCode, getName() + ": timeout after " + executionTimeout + " millis: exit code =" + timeoutCode); } }
/** * handle timeout response by escalating it to a failure */ @Override public void run() { try { synchronized (processTerminated) { if (!processTerminated.get()) { processTerminated.wait(executionTimeout); } } } catch (InterruptedException e) { //assume signalled; exit } //check the status; if the marker isn't true, bail if (!processTerminated.getAndSet(true)) { LOG.info("process timeout: reporting error code {}", timeoutCode); //timeout if (isInState(STATE.STARTED)) { //trigger a failure stopForkedProcess(); } reportFailure(timeoutCode, getName() + ": timeout after " + executionTimeout + " millis: exit code =" + timeoutCode); } }
@Override // notification from executed process public void onProcessExited(LongLivedProcess process, int uncorrected, int code) { try { synchronized (this) { completed(); //note whether or not the service had already stopped LOG.debug("Process has exited with exit code {}", code); if (code != 0) { reportFailure(code, getName() + " failed with code " + code); } } } finally { stop(); } }
@Override // notification from executed process public void onProcessExited(LongLivedProcess process, int uncorrected, int code) { try { synchronized (this) { completed(); //note whether or not the service had already stopped LOG.debug("Process has exited with exit code {}", code); if (code != 0) { reportFailure(code, getName() + " failed with code " + code); } } } finally { stop(); } }