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

Using disableDeferredWipeout within pipeline job results in no deleted workspace

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: Minor Minor
    • ws-cleanup-plugin
    • None
    • wsCleanup 0.36 and Jenkins ver. 2.138.2
      Jenkins node is Fedora 28

      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() }

      }

       

          [JENKINS-54225] Using disableDeferredWipeout within pipeline job results in no deleted workspace

          Johnny Willemsen created issue -
          Johnny Willemsen made changes -
          Environment New: wsCleanup 0.36 and Jenkins ver. 2.138.2
          Jenkins node is Fedora 28
          Johnny Willemsen made changes -
          Description Original: 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}}
          New: 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()}}
          {{ }}}
          {{}}}
          Johnny Willemsen made changes -
          Description Original: 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()}}
          {{ }}}
          {{}}}
          New: 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()
           }
          }

           
          Roufique Hossain made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Oliver Gondža made changes -
          Status Original: In Progress [ 3 ] New: Open [ 1 ]
          Oliver Gondža made changes -
          Assignee Original: Oliver Gondža [ olivergondza ] New: Pavel Janoušek [ pajasoft ]
          Pavel Janoušek made changes -
          Link New: This issue is related to JENKINS-55443 [ JENKINS-55443 ]
          Pavel Janoušek made changes -
          Resolution New: Cannot Reproduce [ 5 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

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

              Created:
              Updated:
              Resolved: