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

Older builds allowed to wait for a throttled stage which a newer build is in

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      The docs suggest that marking a stage with "concurrency: 1" will allow only the latest build to run, and that if older builds reach such a section, it will stop executing:

      "The stage command lets you mark certain sections of a build as being constrained by limited concurrency.
      Newer builds are always given priority when entering such a throttled stage; older builds will simply exit early if they are preëmpted."

      I instead observed an older build simply waiting until a newer build had finished, and then continuing to run the concurrency: 1 section.
      This is a problem for us this is our deploy stage, and we wish to only deploy the latest code.

        Attachments

          Issue Links

            Activity

            mcobden Marcus Cobden created issue -
            jglick Jesse Glick made changes -
            Field Original Value New Value
            Link This issue is related to JENKINS-27039 [ JENKINS-27039 ]
            Hide
            jglick Jesse Glick added a comment -

            The current behavior is as designed. Older builds are canceled if there is a newer build waiting to enter the stage. In other words, if build 1 is in the stage, 2 is waiting to enter, and 3 gets to the same stage statement, 2 will be canceled. If builds reach the stage statement out of order, so build 1 takes a long time to get through earlier stages, and then build 2 enters the stage, 1 will wait for it to exit the stage and then proceed.

            I think what you are looking for is the linear option suggested in JENKINS-27039. I will not mark this a duplicate since the main planned fix there is the eager option, which is for a different purpose.

            Show
            jglick Jesse Glick added a comment - The current behavior is as designed. Older builds are canceled if there is a newer build waiting to enter the stage. In other words, if build 1 is in the stage, 2 is waiting to enter, and 3 gets to the same stage statement, 2 will be canceled. If builds reach the stage statement out of order, so build 1 takes a long time to get through earlier stages, and then build 2 enters the stage, 1 will wait for it to exit the stage and then proceed. I think what you are looking for is the linear option suggested in JENKINS-27039 . I will not mark this a duplicate since the main planned fix there is the eager option, which is for a different purpose.
            jglick Jesse Glick made changes -
            Summary Pre-empted builds not stopped in stage with concurrency:1 Older builds allowed to wait for a throttled stage which a newer build is in
            Hide
            mcobden Marcus Cobden added a comment -

            The linear option sounds exactly like what I was hoping for, thanks!

            Show
            mcobden Marcus Cobden added a comment - The linear option sounds exactly like what I was hoping for, thanks!
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 355 (Web Link)" [ 14037 ]
            Hide
            jglick Jesse Glick added a comment -

            I think the milestone step (in testing) addresses this.

            Show
            jglick Jesse Glick added a comment - I think the milestone step (in testing) addresses this.
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 168521 ] JNJira + In-Review [ 183158 ]
            abayer Andrew Bayer made changes -
            Component/s pipeline-general [ 21692 ]
            abayer Andrew Bayer made changes -
            Component/s workflow-plugin [ 18820 ]
            jglick Jesse Glick made changes -
            Component/s pipeline-milestone-step-plugin [ 21448 ]
            Component/s pipeline-stage-step-plugin [ 21709 ]
            Component/s pipeline [ 21692 ]
            amuniz Antonio Muñiz made changes -
            Assignee Jesse Glick [ jglick ] Antonio Muñiz [ amuniz ]
            amuniz Antonio Muñiz made changes -
            Remote Link This issue links to "PR 355 (Web Link)" [ 14037 ]
            amuniz Antonio Muñiz made changes -
            Remote Link This issue links to "milestone step PR (Web Link)" [ 14862 ]
            Hide
            amuniz Antonio Muñiz added a comment -

            Released as pipeline-milestone-step:1.0.

            Show
            amuniz Antonio Muñiz added a comment - Released as pipeline-milestone-step:1.0 .
            amuniz Antonio Muñiz made changes -
            Resolution Fixed [ 1 ]
            Status Open [ 1 ] Closed [ 6 ]

              People

              Assignee:
              amuniz Antonio Muñiz
              Reporter:
              mcobden Marcus Cobden
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: