If you have a Queue.Executable that should consume an executor (so is not from a FlyweightTask), it unconditionally blocks "safe restart": RestartListener.Default merely checks for the existence of at least one busy executor. For an executable using the durable-task plugin or similar, this is undesirable, since the task can in fact survive a Jenkins restart. There should be a way to mark an Executable (or its parent Task) as not blocking restart.
There is already NonBlockingTask but this controls whether the task can be scheduled while Jenkins is quieting down, while this issue pertains to tasks which are already running and are safe to interrupt.
As an aside, Jenkins.doSafeExit inexplicably has its own copy of safe shutdown code which neglects to use doQuietDown(true, 0) like doSafeRestart does, and thus does not consider RestartListener.
- depends on
-
JENKINS-32015 Stop Groovy code execution during quietingDown
- Resolved
- is related to
-
JENKINS-25938 Lock an Executor without creating a Thread
- Resolved
-
JENKINS-26900 Hide flyweight master executor when ≥1 heavyweight executors running as subtasks
- Resolved
- links to