Skip to content
Permalink
Browse files

fix JENKINS-31768 dead lock while removing computer

  • Loading branch information
fengxx committed Nov 28, 2015
1 parent 67a42ea commit c7fd90a8796fe0ad80bfe37a9837af4515fbf5cb
Showing with 13 additions and 1 deletion.
  1. +13 −1 core/src/main/java/hudson/model/Computer.java
@@ -828,7 +828,19 @@ protected void kill() {
protected void onRemoved(){
}

private synchronized void setNumExecutors(int n) {
/**
* Calling path, *means protected by Queue.withLock
*
* Computer.doConfigSubmit -> Computer.replaceBy ->Jenkins.setNodes* ->Computer.setNode
* AbstractCIBase.updateComputerList->Computer.inflictMortalWound*
* AbstractCIBase.updateComputerList->AbstractCIBase.updateComputer* ->Computer.setNode
* AbstractCIBase.updateComputerList->AbstractCIBase.killComputer->Computer.kill
* Computer.constructor->Computer.setNode
* Computer.kill is called after numExecutors set to zero(Computer.inflictMortalWound) so not need the Queue.lock
*
* @param number of executors
*/
private void setNumExecutors(int n) {
this.numExecutors = n;
final int diff = executors.size()-n;

0 comments on commit c7fd90a

Please sign in to comment.