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

Using disableDeferredWipeout within pipeline job results in no deleted workspace

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Minor
    • Resolution: Cannot Reproduce
    • ws-cleanup-plugin
    • None
    • wsCleanup 0.36 and Jenkins ver. 2.138.2
      Jenkins node is Fedora 28

    Description

      We are using pipeline and at the end of the pipeline we have a stage as below. We added the disableDeferredWipeout recently to make sure that all disk space of the workspace is reclaimed before the job ends. We now notice that the workspace is not deleted anymore, when we remove the disableDeferredWipeout the workspace directory is gone again. Have tried to find some logs but can't find anything.

      stage('Post cleanup') {

      step([$class: 'WsCleanup', disableDeferredWipeout: true])

      }

      In the log we only get the message below but at the end the workspace is still there

      [WS-CLEANUP] Deleting project workspace...
      [WS-CLEANUP] Deferred wipeout is disabled by the job configuration...
      [WS-CLEANUP] done

       

      As reproducer you can use the pipeline job below, only adapt the node argument. After the pipeline job has finished we would expect to have an empty workspace but with disableDeferredWipeout:true the buildtools directory is still there, without the argument the workspace is deleted

      node('Scarab_fc28_x86_64_01') {
      stage('Pre cleanup')

      { cleanWs() }

      stage('Buildtools checkout') {
      dir ('buildtools')

      { git changelog: false, poll: false, url: 'https://github.com/DOCGroup/MPC', shallow: true }

      }

      stage('Post cleanup')

      { cleanWs disableDeferredWipeout:true // cleanWs() }

      }

       

      Attachments

        Issue Links

          Activity

            I can confirm that adding deleteDirs solved the issue of the partial delete.

            As workaround on Windows we use `rm -rf` from MinGW, it looks that we have some files in the workspace which are still in use in some builds, rm can remove them without problems, with get the error below, is there a forced delete options (... is a full path)

            ERROR: Cannot delete workspace :Unable to delete '...ACE_ETCL_Parserd.dll’. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
            Error when executing always post condition:
            hudson.AbortException: Cannot delete workspace: Unable to delete '...\ACE_ETCL_Parserd.dll’. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts.
            at hudson.plugins.ws_cleanup.WsCleanup.perform(WsCleanup.java:244)
            at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)

            jwillemsen Johnny Willemsen added a comment - I can confirm that adding deleteDirs solved the issue of the partial delete. As workaround on Windows we use `rm -rf` from MinGW, it looks that we have some files in the workspace which are still in use in some builds, rm can remove them without problems, with get the error below, is there a forced delete options (... is a full path) ERROR: Cannot delete workspace :Unable to delete '...ACE_ETCL_Parserd.dll’. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. Error when executing always post condition: hudson.AbortException: Cannot delete workspace: Unable to delete '...\ACE_ETCL_Parserd.dll’. Tried 3 times (of a maximum of 3) waiting 0.1 sec between attempts. at hudson.plugins.ws_cleanup.WsCleanup.perform(WsCleanup.java:244) at org.jenkinsci.plugins.workflow.steps.CoreStep$Execution.run(CoreStep.java:80)

            Thank you for your confirmation jwillemsen. If there isn't a complain soon, I'll close this issue without any additional action item.

            pajasoft Pavel Janoušek added a comment - Thank you for your confirmation jwillemsen . If there isn't a complain soon, I'll close this issue without any additional action item.

            Shouldn't the plugin set deleteDirs to true in case we do a deferred delete? Or at least have some documentation extensions to mention this, this is confusing for people who think they just disable the async delete and get strange errors due to that

            jwillemsen Johnny Willemsen added a comment - Shouldn't the plugin set deleteDirs to true in case we do a deferred delete? Or at least have some documentation extensions to mention this, this is confusing for people who think they just disable the async delete and get strange errors due to that

            jwillemsen Good idea, I've put a note to the wiki.

            pajasoft Pavel Janoušek added a comment - jwillemsen Good idea, I've put a note to the wiki.

            The same can be achieved with the proper plugin setting.

            pajasoft Pavel Janoušek added a comment - The same can be achieved with the proper plugin setting.

            People

              pajasoft Pavel Janoušek
              jwillemsen Johnny Willemsen
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: