Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-74908

Option disableConcurrentBuilds(abortPrevious: true) still allows two job instances to execute in parallel, causing problems

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • workflow-job-plugin
    • None

      When the Jenkins pipeline uses the below option,

      options {
          disableConcurrentBuilds(abortPrevious: true)
        }
      

      to cancel the previously running build, there still might be more than one job instance running at the same time leading to problems.

      One issue caused by this:
      https://github.com/jenkinsci/bitbucket-branch-source-plugin/issues/768

      Other people also reporting about issues with this approach:
      https://stackoverflow.com/a/70375236

      Citing:

      But in my case, the old build takes some time to abort, So the new build automatically takes a second workplace i.e "xxxxxx@2". since I am hardcoding the workspace path so the new build is getting failed. is there any workaround for this? 

      ^ And this is the biggest issue for me as well. We have a very large mono repository project with 100 GB+ of data where we try to re-use the workspace.

      This bug causes TWO workspaces to be kept around, wasting lots of space and also causing other issues such as Git index locks still being held, etc.

            Unassigned Unassigned
            kfunk Kevin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: