// if the subtype already derives disconnect(OfflineCause), delegate to it
// if the subtype already derives disconnect(OfflineCause), delegate to it
returndisconnect(null);
returndisconnect(null);
...
@@ -442,7 +501,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
...
@@ -442,7 +501,7 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
@CLIMethod(name="offline-node")
@CLIMethod(name="offline-node")
publicvoidcliOffline(@Option(name="-m",usage="Record the note about why you are disconnecting this node")Stringcause)throwsExecutionException,InterruptedException{
publicvoidcliOffline(@Option(name="-m",usage="Record the note about why you are disconnecting this node")Stringcause)throwsExecutionException,InterruptedException{
checkPermission(DISCONNECT);
checkPermission(DISCONNECT);
setTemporarilyOffline(true,newByCLI(cause));
setTemporarilyOffline(true,newByCLI(cause));
}
}
@CLIMethod(name="online-node")
@CLIMethod(name="online-node")
...
@@ -698,6 +757,26 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
...
@@ -698,6 +757,26 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
* @see #onRemoved()
* @see #onRemoved()
*/
*/
protectedvoidkill(){
protectedvoidkill(){
// On most code paths, this should already be zero, and thus this next call becomes a no-op... and more
// importantly it will not acquire a lock on the Queue... not that the lock is bad, more that the lock
// may delay unnecessarily
setNumExecutors(0);
}
/**
* Called by {@link Jenkins#updateComputerList()} to notify {@link Computer} that it will be discarded.
*
* <p>
* Note that at this point {@link #getNode()} returns null.
*
* <p>
* Note that the Queue lock is already held when this method is called.
*
* @see #onRemoved()
*/
@Restricted(NoExternalUse.class)
@GuardedBy("hudson.model.Queue.lock")
/*package*/voidinflictMortalWound(){
setNumExecutors(0);
setNumExecutors(0);
}
}
...
@@ -808,6 +887,28 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces
...
@@ -808,6 +887,28 @@ public /*transient*/ abstract class Computer extends Actionable implements Acces