[JIRA] (JENKINS-58780) Jenkins cancels the wrong build, when using QueueTaskFuture.cancel()

1 view
Skip to first unread message

martin.h.schroeder@intel.com (JIRA)

unread,
Aug 2, 2019, 5:50:04 AM8/2/19
to jenkinsc...@googlegroups.com
Martin Schröder created an issue
 
Jenkins / Bug JENKINS-58780
Jenkins cancels the wrong build, when using QueueTaskFuture.cancel()
Issue Type: Bug Bug
Assignee: Martin Schröder
Components: core
Created: 2019-08-02 09:49
Environment: Any (Core issue)
Labels: jenkins queue cancel build
Priority: Minor Minor
Reporter: Martin Schröder

When cancelling a build for a specific Future object, Jenkins currently does not care about actually cancelling the queue item that corresponds to the given future. Instead, it simply cancel the first build for the same task that it can find.

This can be easily replicated by starting two jobs with different parameters via a Groovy script without having any build hosts online (so that they get queued).

The script should hold onto the returned QueueTaskFuture objects and then issue a cancellation on only one of them.

Current Jenkins behaviour is to always cancel the first of the tasks, no matter which of the two future objects were called.

This does not just affect programmatic calling of builds, but can also happen in downstream-triggered tasks and other build starting methods that rely on a cancellation via the QueueTaskFuture instance being reliable.

A new Unittest is going to be provided in the pull request for this scenario.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages