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

Asynchronous cleanup not removing renamed workspace directories on slaves

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • ws-cleanup-plugin
    • None
    • Jenkins 1.579
      ws-cleanup 0.24

      After upgrading to ws-cleanup 0.24 in order to get the asynchronous cleanup function we noticed the workspaces on our slaves getting renamed to the form of ${WORKSPACE}ws-cleanup${TIMESTAMP}. (ie, job1 would become job1_ws-cleanup_1411197183394). The expected behavior under ws-cleanup 0.24 is that these were temporary to support asynchronous processing and would be deleted. However, these directories never get removed from the slave. Over time, the slave hard drives filled up resulting in build failures.

          [JENKINS-24824] Asynchronous cleanup not removing renamed workspace directories on slaves

          Albert V added a comment -

          I'm experiencing the same issue within an updated Jenkins (2.53) and ws-cleanup plugin (0.32).
          I wanted to note that when I'm using the ws-cleanup into a pipeline, is working as expected. But when I'm using it into a regular Maven job it is leaving the famous directory with a timestamp (one per build!) and is filling the workspace of my slaves.

          I think that this issue should be re-opened because there are more cases like this one.

          Albert V added a comment - I'm experiencing the same issue within an updated Jenkins (2.53) and ws-cleanup plugin (0.32). I wanted to note that when I'm using the ws-cleanup into a pipeline, is working as expected. But when I'm using it into a regular Maven job it is leaving the famous directory with a timestamp (one per build!) and is filling the workspace of my slaves. I think that this issue should be re-opened because there are more cases like this one.

          I could replicate the issue if you disconnect the agent when the prebuild cleanup it is make, if you do that the temporal folder will never be deleted

          Ivan Fernandez Calvo added a comment - I could replicate the issue if you disconnect the agent when the prebuild cleanup it is make, if you do that the temporal folder will never be deleted

          brian hewson added a comment -

          gjphilp I had the same problem of having to manually remove hundreds of reports.

          curl -s http://${JENKINS_URL}/administrativeMonitor/AsyncResourceDisposer/ -u${UTILITY_USER}:${UTILITY_PW} | tr '"' '\n' | grep 'stop-tracking' | cut -d '-' -f 3 | sort -n | while read ASYNC_THREAD; do curl http://${JENKINS_URL}/administrativeMonitor/AsyncResourceDisposer/stopTracking -u${UTILITY_USER}:${UTILITY_PW} -X POST --data "id=${ASYNC_THREAD}"; done

          Heap usage dropped significantly immediately after cleanup of 337 threads. 

          brian hewson added a comment - gjphilp I had the same problem of having to manually remove hundreds of reports. curl -s http: //${JENKINS_URL}/administrativeMonitor/AsyncResourceDisposer/ -u${UTILITY_USER}:${UTILITY_PW} | tr ' "' '\n' | grep 'stop-tracking' | cut -d '-' -f 3 | sort -n | while read ASYNC_THREAD; do curl http://${JENKINS_URL}/administrativeMonitor/AsyncResourceDisposer/stopTracking -u${UTILITY_USER}:${UTILITY_PW} -X POST --data " id=${ASYNC_THREAD}"; done Heap usage dropped significantly immediately after cleanup of 337 threads. 

          Cesar Ibarra added a comment -

          Can anyone explain me how they resolve this?
          I am using Jenkins 2.107.2 with ws-cleanup 0.34 and I am also experience the issue of a lingering ws-cleanup folder with the timestamp which didn't get deleted.
          I am running Jenkins on a OS Ubuntu 16.04.

          Any help on how to solve this?

          Cesar Ibarra added a comment - Can anyone explain me how they resolve this? I am using Jenkins 2.107.2 with ws-cleanup 0.34 and I am also experience the issue of a lingering ws-cleanup folder with the timestamp which didn't get deleted. I am running Jenkins on a OS Ubuntu 16.04. Any help on how to solve this?

          Guys, this ticket was resolved year and a half ago. Please, file a separate issue.

          Oliver Gondža added a comment - Guys, this ticket was resolved year and a half ago. Please, file a separate issue.

          But the problem still persists (here too, BTW.). So why file a new issue for the VERY SAME problem? Reopening a ticket is common practice in such cases.

          Dirk Heinrichs added a comment - But the problem still persists (here too, BTW.). So why file a new issue for the VERY SAME problem? Reopening a ticket is common practice in such cases.

          We also have this issue but only on Windows slaves (connected through Cygwin SSH).

          Adam Brousseau added a comment - We also have this issue but only on Windows slaves (connected through Cygwin SSH).

          Have the same issue. Jenkins 2.121.1 in docker container(workspace on volume) , ws-cleanup 0.34

          Denis Zakharov added a comment - Have the same issue. Jenkins 2.121.1 in docker container(workspace on volume) , ws-cleanup 0.34

          Guys, this ticket was resolved year and a half ago. Please, file a separate issue.

          Oliver Gondža added a comment - Guys, this ticket was resolved year and a half ago. Please, file a separate issue.

          Opened https://issues.jenkins-ci.org/browse/JENKINS-53579 now can we get this addressed?

          Jakub Bochenski added a comment - Opened https://issues.jenkins-ci.org/browse/JENKINS-53579 now can we get this addressed?

            olivergondza Oliver Gondža
            tmoore Tom Moore
            Votes:
            18 Vote for this issue
            Watchers:
            40 Start watching this issue

              Created:
              Updated:
              Resolved: