private void interrupt(Result result, boolean forShutdown, CauseOfInterruption... causes) { if (LOGGER.isLoggable(FINE)) LOGGER.log(FINE, String.format("%s is interrupted(%s): %s", getDisplayName(), result, Util.join(Arrays.asList(causes),",")), new InterruptedException()); lock.writeLock().lock(); try { if (!started) { // not yet started, so simply dispose this owner.removeExecutor(this); return; } interruptStatus = result; for (CauseOfInterruption c : causes) { if (!this.causes.contains(c)) this.causes.add(c); } if (asynchronousExecution != null) { asynchronousExecution.interrupt(forShutdown); } else { super.interrupt(); } } finally { lock.writeLock().unlock(); } }
private void finish2() { for (RuntimeException e1 : owner.getTerminatedBy()) { LOGGER.log(Level.FINE, String.format("%s termination trace", getName()), e1); } owner.removeExecutor(this); if (this instanceof OneOffExecutor) { owner.remove((OneOffExecutor) this); } executableEstimatedDuration = DEFAULT_ESTIMATED_DURATION; queue.scheduleMaintenance(); }
if (!owner.isOnline()) { resetWorkUnit("went off-line before the task's worker thread started"); owner.removeExecutor(this); queue.scheduleMaintenance(); return; owner.removeExecutor(this); queue.scheduleMaintenance(); return;
private void interrupt(Result result, boolean forShutdown, CauseOfInterruption... causes) { if (LOGGER.isLoggable(FINE)) LOGGER.log(FINE, String.format("%s is interrupted(%s): %s", getDisplayName(), result, Util.join(Arrays.asList(causes),",")), new InterruptedException()); lock.writeLock().lock(); try { if (!started) { // not yet started, so simply dispose this owner.removeExecutor(this); return; } interruptStatus = result; for (CauseOfInterruption c : causes) { if (!this.causes.contains(c)) this.causes.add(c); } if (asynchronousExecution != null) { asynchronousExecution.interrupt(forShutdown); } else { super.interrupt(); } } finally { lock.writeLock().unlock(); } }
private void finish2() { for (RuntimeException e1 : owner.getTerminatedBy()) { LOGGER.log(Level.FINE, String.format("%s termination trace", getName()), e1); } owner.removeExecutor(this); if (this instanceof OneOffExecutor) { owner.remove((OneOffExecutor) this); } queue.scheduleMaintenance(); }
/** * Throws away this executor and get a new one. */ public HttpResponse doYank() { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (isAlive()) throw new Failure("Can't yank a live executor"); owner.removeExecutor(this); return HttpResponses.redirectViaContextPath("/"); }
/** * Throws away this executor and get a new one. */ public HttpResponse doYank() { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (isAlive()) throw new Failure("Can't yank a live executor"); owner.removeExecutor(this); return HttpResponses.redirectViaContextPath("/"); }
/** * Throws away this executor and get a new one. */ public HttpResponse doYank() { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (isAlive()) { throw new Failure("Can't yank a live executor"); } owner.removeExecutor(this); return HttpResponses.redirectViaContextPath("/"); }
/** * Throws away this executor and get a new one. */ public HttpResponse doYank() { Hudson.getInstance().checkPermission(Hudson.ADMINISTER); if (isAlive()) throw new Failure("Can't yank a live executor"); owner.removeExecutor(this); return HttpResponses.redirectViaContextPath("/"); }
if (!owner.isOnline()) { resetWorkUnit("went off-line before the task's worker thread started"); owner.removeExecutor(this); queue.scheduleMaintenance(); return; owner.removeExecutor(this); queue.scheduleMaintenance(); return;
if (owner.getNumExecutors() < owner.getExecutors().size()) { owner.removeExecutor(this); return;
if(owner.getNumExecutors()<owner.getExecutors().size()) { owner.removeExecutor(this); return;
if(owner.getNumExecutors()<owner.getExecutors().size()) { owner.removeExecutor(this); return;
if(owner.getNumExecutors()<owner.getExecutors().size()) { owner.removeExecutor(this); return;