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

Race condition can prevent setup wizard from initializing properly

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core

      The setup wizard initialization currently happens once the InitMilestone.COMPLETED is reached.

      On the first Jenkins startup, there is a risk that some code executed in another thread would call Jenkins#save before the setup wizard is initialized. Such code could be a groovy script, or in a third-party plugin.

      In such a case, the Setup Wizard would be initialized with state RESTART and the instance wouldn't be initialized as expected.

          [JENKINS-49401] Race condition can prevent setup wizard from initializing properly

          Vincent Latombe created issue -
          Vincent Latombe made changes -
          Assignee New: Vincent Latombe [ vlatombe ]
          Vincent Latombe made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Vincent Latombe made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Vincent Latombe made changes -
          Remote Link New: This issue links to "PR #3282 (Web Link)" [ 20019 ]
          CloudBees Inc. made changes -
          Remote Link New: This issue links to "CloudBees Internal TIGER-4255 (Web Link)" [ 20149 ]

          Code changed in jenkins
          User: Vincent Latombe
          Path:
          core/src/main/java/jenkins/model/Jenkins.java
          http://jenkins-ci.org/commit/jenkins/9f599911f6125cd69dc45718a4bbf79644be74e8
          Log:
          JENKINS-49401 Move Setup Wizard initialization logic to the init reactor. (#3282)

          This way, it is guaranteed Jenkins.save() has never been called before
          the SetupWizard is executed, and computation of the initial Setup Wizard
          state will be correct.

          Since the SetupWizard is now executed before reaching the COMPLETED
          milestone, a Jenkins.save() call has been added in order to persist any
          configuration change done in prior phases.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/jenkins/model/Jenkins.java http://jenkins-ci.org/commit/jenkins/9f599911f6125cd69dc45718a4bbf79644be74e8 Log: JENKINS-49401 Move Setup Wizard initialization logic to the init reactor. (#3282) This way, it is guaranteed Jenkins.save() has never been called before the SetupWizard is executed, and computation of the initial Setup Wizard state will be correct. Since the SetupWizard is now executed before reaching the COMPLETED milestone, a Jenkins.save() call has been added in order to persist any configuration change done in prior phases.
          Vincent Latombe made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: In Review [ 10005 ] New: Resolved [ 5 ]

          Oleg Nenashev added a comment -

          The fix has been integrated towards 2.114.

          Oleg Nenashev added a comment - The fix has been integrated towards 2.114.
          Oleg Nenashev made changes -
          Labels New: lts-candidate

            vlatombe Vincent Latombe
            vlatombe Vincent Latombe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: