FutureImpl.cancel() doesn't cancel the linked job

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Unassigned
            Reporter:
            Yoann Dubreuil
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: