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

Queue is not persisted on Safe Restart when Jenkins is installed as Windows Service (clean up is not performed)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
    • Environment:
      Jenkins 1.647 installed as Windows Service
    • Similar Issues:

      Description

      When Jenkins is installed as Windows Service the queue is not persisted on Safe Restart.

      Steps to reproduce

      • Fresh install Jenkins on Windows as a Windows Service
      • Remove all available executors (set it to 0)
      • Configure a job
      • Run the job
      • The job must be put in queue, and must not run because there are no available executors.
      • Safe restart Jenkins

      Expected result

      • On safe restart the queue.xml file should be created for the queue to be restored on start
      • Ultimately the queue should be restored on start

      Actual result

      • No queue.xml file is created
      • The queue is not restored after restart

      This works on Mac OS X, and works if running a Jenkins instance with Maven HPI Plugin or similar on Windows.

        Attachments

          Issue Links

            Activity

            Hide
            atcarmo André Carmo added a comment -

            This problem happens because Jenkins.cleanUp() method is not being called on WindowsServiceLifecycle.restart() method. It is only called in the restart implementation of UnixLifecycle and SolarisSMFLifecycle. It is also called inside WebAppMain.contextDestroyed().

            Will create a pull request.

            Show
            atcarmo André Carmo added a comment - This problem happens because Jenkins.cleanUp() method is not being called on WindowsServiceLifecycle.restart() method. It is only called in the restart implementation of UnixLifecycle and SolarisSMFLifecycle. It is also called inside WebAppMain.contextDestroyed(). Will create a pull request.
            Hide
            atcarmo André Carmo added a comment -

            Created pull request on GitHub: https://github.com/jenkinsci/jenkins/pull/2019

            Show
            atcarmo André Carmo added a comment - Created pull request on GitHub: https://github.com/jenkinsci/jenkins/pull/2019
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/WebAppMain.java
            core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
            core/src/main/java/hudson/lifecycle/UnixLifecycle.java
            core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java
            http://jenkins-ci.org/commit/jenkins/579a88d6e790729159b50840dc78c0f4ae2ba5f6
            Log:
            Merge branch 'JENKINS-32820' of https://github.com/atcarmo/jenkins into bug/JENKINS-32820

            Conflicts:
            core/src/main/java/hudson/WebAppMain.java
            core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
            core/src/main/java/hudson/lifecycle/UnixLifecycle.java

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/WebAppMain.java core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java core/src/main/java/hudson/lifecycle/UnixLifecycle.java core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java http://jenkins-ci.org/commit/jenkins/579a88d6e790729159b50840dc78c0f4ae2ba5f6 Log: Merge branch ' JENKINS-32820 ' of https://github.com/atcarmo/jenkins into bug/ JENKINS-32820 Conflicts: core/src/main/java/hudson/WebAppMain.java core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java core/src/main/java/hudson/lifecycle/UnixLifecycle.java
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
            core/src/main/java/hudson/lifecycle/UnixLifecycle.java
            core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java
            http://jenkins-ci.org/commit/jenkins/08a993d7bcd3590ccbfa9504cd45fbba540fd354
            Log:
            JENKINS-32820 Fix the last merge issues

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java core/src/main/java/hudson/lifecycle/UnixLifecycle.java core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java http://jenkins-ci.org/commit/jenkins/08a993d7bcd3590ccbfa9504cd45fbba540fd354 Log: JENKINS-32820 Fix the last merge issues
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/WebAppMain.java
            core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
            core/src/main/java/hudson/lifecycle/UnixLifecycle.java
            core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java
            http://jenkins-ci.org/commit/jenkins/4ab693846ca7a4aa112959a2e92688c3fb9122c3
            Log:
            Merge pull request #2746 from oleg-nenashev/bug/JENKINS-32820

            [JENKINS-32820, JENKINS-42164] - Windows service restart does not retain the build queue

            Compare: https://github.com/jenkinsci/jenkins/compare/1763e6400f56...4ab693846ca7

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/WebAppMain.java core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java core/src/main/java/hudson/lifecycle/UnixLifecycle.java core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java http://jenkins-ci.org/commit/jenkins/4ab693846ca7a4aa112959a2e92688c3fb9122c3 Log: Merge pull request #2746 from oleg-nenashev/bug/ JENKINS-32820 [JENKINS-32820, JENKINS-42164] - Windows service restart does not retain the build queue Compare: https://github.com/jenkinsci/jenkins/compare/1763e6400f56...4ab693846ca7
            Hide
            danielbeck Daniel Beck added a comment -

            Oleg Nenashev is this resolved?

            Show
            danielbeck Daniel Beck added a comment - Oleg Nenashev is this resolved?
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Yes, it is resolved.
            Maybe it could be even the lts-candidate

            Show
            oleg_nenashev Oleg Nenashev added a comment - Yes, it is resolved. Maybe it could be even the lts-candidate
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Oleg Nenashev
            Path:
            core/src/main/java/hudson/WebAppMain.java
            core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java
            core/src/main/java/hudson/lifecycle/UnixLifecycle.java
            core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java
            http://jenkins-ci.org/commit/jenkins/5f655a59b6d263061d6c5c1d05ac8d5d1d1d391f
            Log:
            Merge pull request #2746 from oleg-nenashev/bug/JENKINS-32820

            [JENKINS-32820, JENKINS-42164] - Windows service restart does not retain the build queue
            (cherry picked from commit 4ab693846ca7a4aa112959a2e92688c3fb9122c3)

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/hudson/WebAppMain.java core/src/main/java/hudson/lifecycle/SolarisSMFLifecycle.java core/src/main/java/hudson/lifecycle/UnixLifecycle.java core/src/main/java/hudson/lifecycle/WindowsServiceLifecycle.java http://jenkins-ci.org/commit/jenkins/5f655a59b6d263061d6c5c1d05ac8d5d1d1d391f Log: Merge pull request #2746 from oleg-nenashev/bug/ JENKINS-32820 [JENKINS-32820, JENKINS-42164] - Windows service restart does not retain the build queue (cherry picked from commit 4ab693846ca7a4aa112959a2e92688c3fb9122c3)

              People

              • Assignee:
                atcarmo André Carmo
                Reporter:
                atcarmo André Carmo
              • Votes:
                1 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: