When Jenkins is stopped, the queue file is created except it's empty. No information about the running jobs or jobs pending in the queue exist.

      It essentially saves a file like:
      <?xml version='1.0' encoding='UTF-8'?>
      <hudson.model.Queue_-State>
      <counter>42</counter>
      <items/>
      </hudson.model.Queue_-State>

      This behavior is a regression from Jenkins 2.0 beta2.

          [JENKINS-34281] Queue isn't saved on any shutdown

          Kristin Whetstone created issue -

          Sam Van Oort added a comment -

          This was my comment from https://issues.jenkins-ci.org/browse/JENKINS-33926 when I discovered this in testfest yesterday:

          100% reproducible with the 2.0-rc WAR running on Mac.

          Test case:

          • Create a pipeline job

          node {
          echo 'stuffs'
          sleep 100
          stage 'Stage 2'
          }

          • Create a freestyle job, set to allow concurrent builds, with the following shell step:
            echo 'I do stuff'
            sleep 100
          • Start up several builds of the pipeline job, to consume executors.
          • Queue up the freestyle project
          • Shutdown jenkins via Ctrl+C

          Result:

          • Command line reports winstone/jetty shutting down
          • queue.xml & queue.xml.bak files are created but contain no information about the queued build or builds. Pipelines that were running will restart however.
          • if Jenkins is started again, build will not run from queue. Indeed it is as if the freestyle project was never queued: new builds will use its build #, no record it ever existed.

          Sam Van Oort added a comment - This was my comment from https://issues.jenkins-ci.org/browse/JENKINS-33926 when I discovered this in testfest yesterday: 100% reproducible with the 2.0-rc WAR running on Mac. Test case: Create a pipeline job node { echo 'stuffs' sleep 100 stage 'Stage 2' } Create a freestyle job, set to allow concurrent builds, with the following shell step: echo 'I do stuff' sleep 100 Start up several builds of the pipeline job, to consume executors. Queue up the freestyle project Shutdown jenkins via Ctrl+C Result: Command line reports winstone/jetty shutting down queue.xml & queue.xml.bak files are created but contain no information about the queued build or builds. Pipelines that were running will restart however. if Jenkins is started again, build will not run from queue. Indeed it is as if the freestyle project was never queued: new builds will use its build #, no record it ever existed.
          Kristin Whetstone made changes -
          Link New: This issue is related to JENKINS-30909 [ JENKINS-30909 ]

          Sam Van Oort added a comment -

          I'd tested on CJE 1.625.16.1 - the queue is maintained when killed by Ctrl+C. Just rechecked, and that is also true on 1.642.x - so it's clearly a regression since then.

          Sam Van Oort added a comment - I'd tested on CJE 1.625.16.1 - the queue is maintained when killed by Ctrl+C. Just rechecked, and that is also true on 1.642.x - so it's clearly a regression since then.
          Sam Van Oort made changes -
          Link New: This issue is related to JENKINS-33926 [ JENKINS-33926 ]
          Spike Washburn made changes -
          Labels Original: 2.0 2.0-rc regression testfest New: 2.0 2.0-planned 2.0-rc regression testfest
          Spike Washburn made changes -
          Assignee New: Kristin Whetstone [ kwhetstone ]

          Also further note on this: if the queue is full of freestyle jobs, then they will not be persisted or restarted at all.

          Kristin Whetstone added a comment - Also further note on this: if the queue is full of freestyle jobs, then they will not be persisted or restarted at all.

          After some searching, found that the queue is persisted correctly on upgrades from 1.x, but not on a new install of 2.0. The only reason a job wouldn't be saved is if it was defined as a TransientTask. There might have been some change to jobs listing them all as TransientTasks or somehow everything is being listed as a TransientTask.

          Kristin Whetstone added a comment - After some searching, found that the queue is persisted correctly on upgrades from 1.x, but not on a new install of 2.0. The only reason a job wouldn't be saved is if it was defined as a TransientTask . There might have been some change to jobs listing them all as TransientTasks or somehow everything is being listed as a TransientTask .
          Manuel Recena Soto made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

            svanoort Sam Van Oort
            kwhetstone Kristin Whetstone
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: