Builds can be deleted while they are still running

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Minor
    • Component/s: core

      Builds can be deleted via theĀ /doDeleteĀ REST API, and theĀ delete-buildsĀ CLI commandĀ while they are still running.Ā The ā€œDelete buildā€ link in the sidepanel of builds is hidden unless !it.building and !it.keepLog, but this is a UI-only restriction. Run.delete has the same issue, but in practice all of the callers that I found in plugins already check whether the build is done building (most calls are in LogRotator implementations where LogRotator.shouldKeepRun handles the issue), but there are some subtle race conditions regarding checking Run.isBuilding instead of Run.isLogUpdated that can lead to LogRotator deleting Pipeline builds while they are in the middle of finishing.

      Deleting a build while it is running can cause various kinds of anomalous behavior as the build continues to run despite its configuration directory being deleted, and it is likely that the build will return after a Jenkins restart since build.xml may be rewritten as the build continues running.

            Assignee:
            Devin Nusbaum
            Reporter:
            Devin Nusbaum
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: