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

"Run Exclusive" does not work after Jenkins restart/prepareForShutdown

      "Run Exclusive" does not work after Jenkins restart/prepareForShutdown.

      I prepared a "MAINTENANCE-BREAK"-job that asks for user input and made it a "Run Exclusive"-job in "Job priorities". I triggered the job, and saw that regular jobs( with default priority) were queued nicely. Then I rebooted the node which runs Jenkins Controller. We have configured Jenkins Controller to enter "prepare for shutdown"-mode when it starts, and it did. I noticed that the regular jobs were still queued, and my "MAINTENANCE-BREAK"-build was still running and waiting for user input. I canceled the  "prepare for shutdown"-mode, and expected the regular jobs to stay in queue because the "MAINTENANCE-BREAK"-build was still running - however those regular jobs started running. Also, any new triggered jobs are not queued even though the "MAINTENANCE-BREAK"-build is still running.

      ( Background: I thought of using the plugin as a work around for: JENKINS-60434 , so I can gracefully take our CI-system down and wait for the pipelines to finish before doing that. )

          [JENKINS-72097] "Run Exclusive" does not work after Jenkins restart/prepareForShutdown

          Kari Niemi added a comment -

          Not sure if this would be related, but I just noticed that my MAINTENANCE-BREAK-build would not continue cleanly after Jenkins restart. Jenkins did show that the build is running - but now that I "Approved" the question for the input-plugin... and waited several minutes ... nothing happened ... it was just stuck - and still Jenkins showed that the build isrunning. The build would not stop before I clicked all the hard-kill links given by Jenkins:

          Started by user Kari Niemi
          [Pipeline] Start of Pipeline
          [Pipeline] stage
          [Pipeline] { (Build)
          [Pipeline] input
          ADMIN actions ready?
          Proceed or Abort
          Resuming build at Fri Sep 29 07:05:15 EEST 2023 after Jenkins restart
          Pausing (Preparing for shutdown)
          Resuming build at Fri Sep 29 07:13:30 EEST 2023 after Jenkins restart
          Pausing (Preparing for shutdown)
          Still paused
          Resuming (Shutdown was canceled)
          Approved by Kari Niemi
          Aborted by Kari Niemi
          Click here to forcibly terminate running steps
          Terminating stage
          Click here to forcibly kill entire build
          Hard kill!
          Finished: ABORTED
           

          This problem with the input-plugin is probably just one of the tens or hundreds of problems, that JENKINS-60434 would address and what I was once again trying to solve -  this time using the "Run exclusive"-mode of the Priority Sorter-plugin.

          Kari Niemi added a comment - Not sure if this would be related, but I just noticed that my MAINTENANCE-BREAK-build would not continue cleanly after Jenkins restart. Jenkins did show that the build is running - but now that I "Approved" the question for the input-plugin... and waited several minutes ... nothing happened ... it was just stuck - and still Jenkins showed that the build isrunning. The build would not stop before I clicked all the hard-kill links given by Jenkins: Started by user Kari Niemi [Pipeline] Start of Pipeline [Pipeline] stage [Pipeline] { (Build) [Pipeline] input ADMIN actions ready? Proceed or Abort Resuming build at Fri Sep 29 07:05:15 EEST 2023 after Jenkins restart Pausing (Preparing for shutdown) Resuming build at Fri Sep 29 07:13:30 EEST 2023 after Jenkins restart Pausing (Preparing for shutdown) Still paused Resuming (Shutdown was canceled) Approved by Kari Niemi Aborted by Kari Niemi Click here to forcibly terminate running steps Terminating stage Click here to forcibly kill entire build Hard kill! Finished: ABORTED This problem with the input-plugin is probably just one of the tens or hundreds of problems, that JENKINS-60434 would address and what I was once again trying to solve -  this time using the "Run exclusive"-mode of the Priority Sorter-plugin.

          Kari Niemi added a comment - - edited

          Also, the pipeline-jobs are not completed, but get paused at next node()-section, when the "Run Exclusive"-job is running. This was not expected nor documented. So the plugin does not serve as a solution for JENKINS-60434 either.

          Kari Niemi added a comment - - edited Also, the pipeline-jobs are not completed, but get paused at next node()-section, when the "Run Exclusive"-job is running. This was not expected nor documented. So the plugin does not serve as a solution for JENKINS-60434 either.

            Unassigned Unassigned
            karniemi Kari Niemi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: