nswamy commented on a change in pull request #8034: Kill running PR builds when
a new build is triggered for the same PR
URL: https://github.com/apache/incubator-mxnet/pull/8034#discussion_r141152379
##########
File path: Jenkinsfile
##########
@@ -11,14 +11,36 @@ max_time = 120
// assign any caught errors here
err = null
+//Method to Kill PR Builds that are running currently when a new build is
triggered.
+def abortPreviousRunningBuilds() {
+ def hi = Hudson.instance
+ def pname = env.JOB_NAME.split('/')[0]
+
+ hi.getItem(pname).getItem(env.JOB_BASE_NAME).getBuilds().each{ build ->
+ def exec = build.getExecutor()
+
+ if (build.number != currentBuild.number && exec != null) {
Review comment:
I have two questions here:
1. Does this apply to merge builds as well?
2. What happens let's say you have 3 builds for the same PR, build #1, #2
and #3 and let's say the order in which the executor is acquired is #1, #3, #2.
When #2 runs after #3. This code will kill #3 and start #2, it should only kill
jobs whose build numbers are lower?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services