Skip to content

Commit

Permalink
adds workaround for JENKINS-17116
Browse files Browse the repository at this point in the history
  • Loading branch information
Øyvind Harboe authored and Øyvind Harboe committed Apr 10, 2015
1 parent d6b223b commit 0eff041
Showing 1 changed file with 16 additions and 0 deletions.
Expand Up @@ -126,6 +126,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 @@ -1913,6 +1923,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 0eff041

Please sign in to comment.