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

DeadBranchStrategy should avoid deleting projects with active jobs

      If you create a DefaultDeadBranchStrategy with 0 days to live, and 0 builds to keep, you can easily create a situation where a branch can be deleted while a job on it is active.

      When branches are re-indexed, the project will be deleted and interrupt active jobs.

      I believe a more appropriate course would be to wait for a branch indexing to run while the project is inactive, a state which once entered it shouldn't leave since the branch was deleted (unless it were recreated).

          [JENKINS-25240] DeadBranchStrategy should avoid deleting projects with active jobs

          Matthew Moore created issue -

          Jesse Glick added a comment -

          Probably suffices to just skip deletion while there is a build running.

          Jesse Glick added a comment - Probably suffices to just skip deletion while there is a build running.
          Patrick Wolf made changes -
          Labels New: 2.0
          Jesse Glick made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]
          Jesse Glick made changes -
          Assignee Original: Matthew Moore [ mattmoor ] New: Jesse Glick [ jglick ]
          Jesse Glick made changes -
          Labels Original: 2.0 New: 2.0-planned
          Jesse Glick made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]

          Jesse Glick added a comment -

          JENKINS-32783 tracks some problems related to deleting a project with builds running. Solvable, but anyway I think the friendlier course is to just skip this branch project this time around. It will still be removed on the next branch indexing, assuming the build has finished by then and the branch truly remains gone.

          Jesse Glick added a comment - JENKINS-32783 tracks some problems related to deleting a project with builds running. Solvable, but anyway I think the friendlier course is to just skip this branch project this time around. It will still be removed on the next branch indexing, assuming the build has finished by then and the branch truly remains gone.
          Jesse Glick made changes -
          Link New: This issue is related to JENKINS-32783 [ JENKINS-32783 ]

          Jesse Glick added a comment -

          The most natural point of implementation seems to be in DefaultOrphanedItemStrategy, which is already paying attention to build history.

          Jesse Glick added a comment - The most natural point of implementation seems to be in DefaultOrphanedItemStrategy , which is already paying attention to build history.
          Jesse Glick made changes -
          Component/s New: cloudbees-folder-plugin [ 18137 ]
          Component/s Original: branch-api-plugin [ 18621 ]
          Labels Original: 2.0-planned New: 2.0-planned multibranch

            jglick Jesse Glick
            mattmoor Matthew Moore
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: