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

CauseOfInterruption.UserInterruption#print() may cause creation of previously deleted users

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core

      Just a minor bug, which may potentially happen due to the race condition if a task is being executed with SYSTEM authentication.

      • UserInterruption#getUser() uses User.get(String), which creates users on demand.
      • When we create CauseOfInterruption.UserInterruption, we expect it exists
      • BUT: the user may be deleted from parallel thread by the time we call UserInterruption#print, which invokes getUser()
      • In such case the recently deleted user will be recreated

          [JENKINS-36594] CauseOfInterruption.UserInterruption#print() may cause creation of previously deleted users

          Oleg Nenashev added a comment -

          Oleg Nenashev added a comment - https://github.com/jenkinsci/jenkins/pull/2450

          Daniel Beck added a comment -

          Fixed in 2.14 (2016/07/17)

          Daniel Beck added a comment - Fixed in 2.14 (2016/07/17)

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/model/CauseOfInterruption.java
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties
          http://jenkins-ci.org/commit/jenkins/91ad59214234e7724d586f64f8fb6db35104857b
          Log:
          [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630)

          • [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing

          It is a regression introduced in JENKINS-36594

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/model/CauseOfInterruption.java core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties http://jenkins-ci.org/commit/jenkins/91ad59214234e7724d586f64f8fb6db35104857b Log: [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630) [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing It is a regression introduced in JENKINS-36594 JENKINS-38721 - Fix typo

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          core/src/main/java/jenkins/model/CauseOfInterruption.java
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties
          core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties
          http://jenkins-ci.org/commit/jenkins/0399037f842d1c9c4fbbc970421fafa3ecdac7eb
          Log:
          [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630)

          • [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing

          It is a regression introduced in JENKINS-36594

          (cherry picked from commit 91ad59214234e7724d586f64f8fb6db35104857b)

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: core/src/main/java/jenkins/model/CauseOfInterruption.java core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.groovy core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_ja.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_pl.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_sr.properties core/src/main/resources/jenkins/model/CauseOfInterruption/UserInterruption/summary_zh_TW.properties http://jenkins-ci.org/commit/jenkins/0399037f842d1c9c4fbbc970421fafa3ecdac7eb Log: [FIXED JENKINS-38721, JENKINS-37282] - NPE in "CauseOfInterruption.UserInterruption" when user is missing (#2630) [FIXED JENKINS-38721] - Prevent NPE during rendering of "CauseOfInterruption.UserInterruption" when user is missing It is a regression introduced in JENKINS-36594 JENKINS-38721 - Fix typo (cherry picked from commit 91ad59214234e7724d586f64f8fb6db35104857b)

          Code changed in jenkins
          User: Jesse Glick
          Path:
          src/test/java/org/jenkinsci/plugins/workflow/steps/CatchErrorStepTest.java
          http://jenkins-ci.org/commit/workflow-basic-steps-plugin/a1073f63461efa41b97d038191610c9dcbd60327
          Log:
          Adjust test to work against -Djenkins.version=2.19.4 after JENKINS-36594 & JENKINS-38721.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: src/test/java/org/jenkinsci/plugins/workflow/steps/CatchErrorStepTest.java http://jenkins-ci.org/commit/workflow-basic-steps-plugin/a1073f63461efa41b97d038191610c9dcbd60327 Log: Adjust test to work against -Djenkins.version=2.19.4 after JENKINS-36594 & JENKINS-38721 .

            Unassigned Unassigned
            oleg_nenashev Oleg Nenashev
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: