Skip to content

[JENKINS-47406] @Initializer(after= InitMilestone.JOB_LOADED) race condition with "Cleaning up obsolete items deleted from the disk" #22362

Closed

Description

@jenkins-infra-bot

When using an @​Initializer(after=InitMilestone.JOB_LOADED creating items, we end up with a race condition with the Cleaning up obsolete items deleted from the disk task if the latter is run after.

It means in some cases, the items get created, and in others they are not in memory but are on filesystem.


Originally reported by vlatombe, imported from: @Initializer(after= InitMilestone.JOB_LOADED) race condition with "Cleaning up obsolete items deleted from the disk"
  • assignee: vlatombe
  • status: Resolved
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2018-01-22T13:04:16+00:00
  • votes: 0
  • watchers: 3
  • imported: 2025-11-24
Raw content of original issue

When using an @Initializer(after=InitMilestone.JOB_LOADED creating items, we end up with a race condition with the Cleaning up obsolete items deleted from the disk task if the latter is run after.

It means in some cases, the items get created, and in others they are not in memory but are on filesystem.

Activity

  1. jenkins-infra-bot commented on Oct 12, 2017

    @jenkins-infra-bot
    Author
  2. jenkins-infra-bot commented on Jan 21, 2018

    @jenkins-infra-bot
    Author
    scm_issue_link:
    • Original comment link
    • Raw content of original comment:

      Code changed in jenkins User: Vincent Latombe Path: core/src/main/java/jenkins/model/Jenkins.java test/src/test/java/jenkins/model/JenkinsTest.java test/src/test/resources/plugins/jenkins-47406.hpi http://jenkins-ci.org/commit/jenkins/0311b2dffa76ba01748b1be6a18fc7c1955e65fe Log: [FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items (#3078)

      • [FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items

      This allows @Initializer(after=InitMilestone.JOB_LOADED) implementations to create items safely without risking them to be removed.

      • Revert "[FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items"

      This reverts commit 79ce796b00fde11fda586c9c9e2b8e93a53e2b31.

      • Reverted this commit by mistake

      Revert "Revert "[FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items""

      This reverts commit 36c499c58c83427c7b8a6d3cc5902ec26732b2c7.

      • Add link to hpi sources
      • Fix Mix-up after the previous merge

    Code changed in jenkins
    User: Vincent Latombe
    Path:
    core/src/main/java/jenkins/model/Jenkins.java
    test/src/test/java/jenkins/model/JenkinsTest.java
    test/src/test/resources/plugins/jenkins-47406.hpi
    http://jenkins-ci.org/commit/jenkins/0311b2dffa76ba01748b1be6a18fc7c1955e65fe
    Log:
    [FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items (#3078)

    • [FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items

    This allows @​Initializer(after=InitMilestone.JOB_LOADED) implementations
    to create items safely without risking them to be removed.

    • Revert "[FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items"

    This reverts commit 79ce796.

    • Reverted this commit by mistake

    Revert "Revert "[FIXES JENKINS-47406] Milestone JOB_LOADED is now attained after cleaning up obsolete items""

    This reverts commit 36c499c.

    • Add link to hpi sources
    • Fix Mix-up after the previous merge
  3. jenkins-infra-bot commented on Jan 22, 2018

    @jenkins-infra-bot
    Author
    oleg_nenashev:
    • Original comment link
    • Raw content of original comment:

      It has been fixed and released in 2.103

    It has been fixed and released in 2.103

  4. removed
    bugFor changelog: Minor bug. Will be listed after features
    on Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions