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

Builds stuck on "is already in progress" forever

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • workflow-job-plugin
    • Centos 7.2.1511 (master and slaves)
      Jenkins 2.176.2
      Jenkins master - open-jdk 1.8.0_212
      Jenkins slaves - Oracle jdk 1.8.0_60

      Jenkins running as docker container (standalone)
      Attached plugin versions as file

    • workflow-job 2.35, workflow-cps 2.74

      After upgrading our jenkins master and plugins, some of our build jobs - specifically it seemed like most pipeline jobs - were stuck waiting for previous build to complete, even though it already completed.

       

      This seems to have been caused by JENKINS-46076.

      After donwngrading the plugin to version 2.32, all builds were working correctly.

       

      From some testing, it seems that calling

      Jenkins.instance.getItemByFullName(...).getBuildByNumber(..).isLogUpdated()
      

      On the previous build (in the sample case build #185) returns true, although the build is completed and the log seems to have been completed.

      This issue happened immediately after restarting the jenkins instance with any of our pipeline jobs

        1. stuck-build-2.tar.gz
          16 kB
        2. failed.PNG
          failed.PNG
          70 kB
        3. Capture2.PNG
          Capture2.PNG
          66 kB
        4. tdump
          75 kB
        5. Capture.PNG
          Capture.PNG
          70 kB
        6. image.png
          image.png
          19 kB
        7. plugins.txt
          5 kB

          [JENKINS-59083] Builds stuck on "is already in progress" forever

          Roy Arnon created issue -
          Roy Arnon made changes -
          Link New: This issue is related to JENKINS-46076 [ JENKINS-46076 ]
          Roy Arnon made changes -
          Description Original: After upgrading our jenkins master and plugins, some of our build jobs - specifically it seemed like most pipeline jobs - were stuck waiting for previous build to complete, even though it already completed.

          !https://files.slack.com/files-pri/T0255EC3D-FMP3HKY56/image.png!

           

          This seems to have been caused by JENKINS-46076.

          After donwngrading the plugin to version 2.32, all build were working correctly.

           

          From some testing, it seems that calling
          {code:java}
          Jenkins.instance.getItemByFullName(...).getBuildByNumber(..).isLogUpdated()
          {code}
          On the previous build (in the sample case build #185) returns true, although the build is completed and the log seems to have been completed.

          This issue happened immediately after restarting the jenkins instance with any of our pipeline jobs
          New: After upgrading our jenkins master and plugins, some of our build jobs - specifically it seemed like most pipeline jobs - were stuck waiting for previous build to complete, even though it already completed.

          !https://files.slack.com/files-pri/T0255EC3D-FMP3HKY56/image.png!

           

          This seems to have been caused by JENKINS-46076.

          After donwngrading the plugin to version 2.32, all builds were working correctly.

           

          From some testing, it seems that calling
          {code:java}
          Jenkins.instance.getItemByFullName(...).getBuildByNumber(..).isLogUpdated()
          {code}
          On the previous build (in the sample case build #185) returns true, although the build is completed and the log seems to have been completed.

          This issue happened immediately after restarting the jenkins instance with any of our pipeline jobs

          Jesse Glick added a comment -

          The image is not loadable anonymously. Use Attach files to copy it to this report.

          If logUpdated is true on a build which appears to be complete, then something went wrong with that build. I really cannot speculate what that might be without steps to reproduce from scratch.

          Jesse Glick added a comment - The image is not loadable anonymously. Use Attach files to copy it to this report. If logUpdated is true on a build which appears to be complete, then something went wrong with that build. I really cannot speculate what that might be without steps to reproduce from scratch.

          Devin Nusbaum added a comment -

          Perhaps related to issues like JENKINS-45571, JENKINS-53223, and JENKINS-50199, where Pipeline builds appear to have completed but are still running in some sense (symptoms include flyweight executors sticking around, and that the "completed" builds resume when Jenkins restarts). I am suspicious of a bug in Pipeline shutdown/cleanup code, but I'm not really sure.

          hellspam Can you reproduce the problem consistently or is it intermittent? Do you see any messages in your Jenkins system logs that seem relevant? Do the old builds that look like they completed resume if you restart Jenkins? What durability setting are you using? If you could upload the full build folder ($JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER) of one of the jobs that is hung, it might help diagnose the problem.

          Devin Nusbaum added a comment - Perhaps related to issues like JENKINS-45571 , JENKINS-53223 , and JENKINS-50199 , where Pipeline builds appear to have completed but are still running in some sense (symptoms include flyweight executors sticking around, and that the "completed" builds resume when Jenkins restarts). I am suspicious of a bug in Pipeline shutdown/cleanup code, but I'm not really sure. hellspam Can you reproduce the problem consistently or is it intermittent? Do you see any messages in your Jenkins system logs that seem relevant? Do the old builds that look like they completed resume if you restart Jenkins? What durability setting are you using? If you could upload the full build folder ( $JENKINS_HOME/jobs/$JOB_NAME/builds/$BUILD_NUMBER ) of one of the jobs that is hung, it might help diagnose the problem.

          Jesse Glick added a comment -

          Yes, I suspect this is not so much an introduced bug as a change which made an existing bug more visible by treating termination conditions more consistently.

          Jesse Glick added a comment - Yes, I suspect this is not so much an introduced bug as a change which made an existing bug more visible by treating termination conditions more consistently.
          Roy Arnon made changes -
          Attachment New: image.png [ 48421 ]

          Jesse Glick added a comment -

          Judging by the cause of blockage, I presume your project is set to disable concurrent builds. (The default for Pipeline is to permit them.)

          Jesse Glick added a comment - Judging by the cause of blockage, I presume your project is set to disable concurrent builds. (The default for Pipeline is to permit them.)

          Roy Arnon added a comment -

          Hi,

          • I can reproduce the error, I am not near a computer right now so I will have that for you by tomorrow.
          • Yes, in this specific project - and probably all stuck builds - we have disabled concurrent builds.

          Roy Arnon added a comment - Hi, I can reproduce the error, I am not near a computer right now so I will have that for you by tomorrow. Yes, in this specific project - and probably all stuck builds - we have disabled concurrent builds.
          Roy Arnon made changes -
          Attachment New: stuck-build.tar.gz [ 48501 ]

            jglick Jesse Glick
            hellspam Roy Arnon
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: