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

Asynchronous delete of workspace doesn't detect fail to rename

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core, ws-cleanup-plugin
    • Labels:
      None
    • Environment:
      Jenkins 1.595. Workspace cleanup plugin 0.24.
      Windows Server 2008 R2 Enterprise. AMD64. Oracle Java 1.7u25.
    • Similar Issues:

      Description

      I've witnessed Jenkins randomly fail to remove a workspace (job configured with "Delete workspace before build starts" selected). This seems to happen randomly and results in the build failing due to old data being present.

      I can force this to occur by opening a command prompt in the workspace before starting the build.

      I've had a quick glance at the Jenkins code, and it looks like the call workspace.renameTo call in the Wipeout class is failing silently. This in turn seems to be because the implementation of renameTo in FilePath doesn't check the return value of the java.lang.File.renameTo call.

      If the workspace cannot be renamed for any reason, the cleanup should either fallback to deleting synchronously (and still potentially fail due to whatever lock prevented the rename) or immediately report an error.

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in jenkins
          User: Oliver Gondža
          Path:
          src/main/java/hudson/plugins/ws_cleanup/Wipeout.java
          src/test/java/hudson/plugins/ws_cleanup/CleanupTest.java
          http://jenkins-ci.org/commit/ws-cleanup-plugin/ab81960e0d39b339f12e034eaf704269161a222d
          Log:
          [FIXED JENKINS-26250] Asynchronous delete of workspace does not detect fail to rename

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oliver Gondža Path: src/main/java/hudson/plugins/ws_cleanup/Wipeout.java src/test/java/hudson/plugins/ws_cleanup/CleanupTest.java http://jenkins-ci.org/commit/ws-cleanup-plugin/ab81960e0d39b339f12e034eaf704269161a222d Log: [FIXED JENKINS-26250] Asynchronous delete of workspace does not detect fail to rename

            People

            • Assignee:
              olivergondza Oliver Gondža
              Reporter:
              pmilliken Paul Milliken
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: