-
Bug
-
Resolution: Fixed
-
Major
-
None
-
core 1.648
FutureImpl.cancel() doesn't cancel the job linked to the Future object, as executor set is always empty. It's supposed to be filled in WorkUnitContext.createWorkUnit() but it's not executed on the Executor thread, unlike the comment suggests:
public WorkUnit createWorkUnit(SubTask execUnit) { Executor executor = Executor.currentExecutor(); if (executor != null) { // TODO is it legal for this to be called by a non-executor thread? future.addExecutor(executor); }
This breaks build cancellation from Jenkins CLI. When a build is started with -s parameter, it's not canceled when the CLI process is interrupted. The CLI handling code in BuildCommand correctly calls FutureImpl.cancel() but nothing happens, as executor set is empty.