Skip to content
Commit c3a19670 authored by Kohsuke Kawaguchi's avatar Kohsuke Kawaguchi
Browse files

[JENKINS-13564] make the method self-correcting

If for some reason the numExecutors field gets out of sync with executors.size() (for example this can happen if an executor swallowed an interrupt signal without properly processing it), then a further attempt to call setNumExecutors(n) results in a no-op.

Given that these things can get out of sync, a smarter thing to do is to always compare where we are (the "executors" variable) and where we'd like to be (numExecutors), and make corrective actions.

This particularly affects a zombie computer. The sequence to kill a Computer first involves waiting for all the executors to quit. If setNumExecutors(0) becomes no-op, a zombine computer never gets killed.
parent 18f394c1
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment