File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/main/java/com/cloudbees/jenkins Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 19
19
import hudson .util .SequentialExecutionQueue ;
20
20
import hudson .util .StreamTaskListener ;
21
21
import java .lang .reflect .Field ;
22
+ import java .util .concurrent .ExecutorService ;
22
23
import java .util .concurrent .Executors ;
23
24
import java .util .concurrent .ThreadFactory ;
24
25
import jenkins .model .Jenkins ;
@@ -266,7 +267,11 @@ synchronized void checkThreadPoolSize() {
266
267
Field getQueue = SCMTrigger .DescriptorImpl .class .getDeclaredField ("queue" );
267
268
getQueue .setAccessible (true );
268
269
SequentialExecutionQueue q = (SequentialExecutionQueue ) getQueue .get (scmTrigger );
269
- this .queue .setExecutors (q .getExecutors ());
270
+ ExecutorService executors = q .getExecutors ();
271
+ if (this .queue .getExecutors () != executors ) {
272
+ // guard or otherwise we will shut it down :-(
273
+ this .queue .setExecutors (executors );
274
+ }
270
275
} catch (NoSuchFieldException | IllegalAccessException | ClassCastException e ) {
271
276
queue .setExecutors (
272
277
(count == 0
You can’t perform that action at this time.
0 commit comments