Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
fix JENKINS-31768 dead lock while removing computer
- Loading branch information
Showing
with
13 additions
and
1 deletion.
-
+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; |
|
|
|
|
|