Skip to content

Commit

Permalink
Merge pull request #224 from zylin/jenkins-17116-workaround
Browse files Browse the repository at this point in the history
adds workaround for JENKINS-17116
  • Loading branch information
rsandell committed May 4, 2015
2 parents afa1cff + 0eff041 commit a9de653
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -128,6 +128,16 @@
public class GerritTrigger extends Trigger<AbstractProject> {

private static final Logger logger = LoggerFactory.getLogger(GerritTrigger.class);

/**
* Default 'true'.
*
* As a workaround for https://issues.jenkins-ci.org/browse/JENKINS-17116 it is
* possible to only remove pending jobs from the queue, but not to
* abort running jobs by setting this to 'false'.
*/
public static final String JOB_ABORT = GerritTrigger.class.getName() + "_job_abort";

//! Association between patches and the jobs that we're running for them
private transient RunningJobs runningJobs = new RunningJobs();
private List<GerritProject> gerritProjects;
Expand Down Expand Up @@ -1931,6 +1941,12 @@ private void cancelJob(GerritTriggeredEvent event) {
Queue.getInstance().cancel(item);
}
}

String workaround = System.getProperty(JOB_ABORT);
if ((workaround != null) && workaround.equals("false")) {
return;
}

// Interrupt any currently running jobs.
Jenkins jenkins = Jenkins.getInstance();
assert jenkins != null;
Expand Down

0 comments on commit a9de653

Please sign in to comment.