{"action":"created","issue":{"url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1800","labels_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1800/labels{/name}","comments_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1800/comments","events_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1800/events","html_url":"https://github.com/jenkinsci/jenkins/pull/1800","id":101442526,"number":1800,"title":"[FIXED JENKINS-15331] Retry failed file delete operations","user":{"login":"pjdarton","id":984537,"avatar_url":"https://avatars.githubusercontent.com/u/984537?v=3","gravatar_id":"","url":"https://api.github.com/users/pjdarton","html_url":"https://github.com/pjdarton","followers_url":"https://api.github.com/users/pjdarton/followers","following_url":"https://api.github.com/users/pjdarton/following{/other_user}","gists_url":"https://api.github.com/users/pjdarton/gists{/gist_id}","starred_url":"https://api.github.com/users/pjdarton/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pjdarton/subscriptions","organizations_url":"https://api.github.com/users/pjdarton/orgs","repos_url":"https://api.github.com/users/pjdarton/repos","events_url":"https://api.github.com/users/pjdarton/events{/privacy}","received_events_url":"https://api.github.com/users/pjdarton/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jenkinsci/jenkins/labels/needs-review","name":"needs-review","color":"207de5"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-08-17T15:01:29Z","updated_at":"2015-10-19T11:08:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jenkinsci/jenkins/pulls/1800","html_url":"https://github.com/jenkinsci/jenkins/pull/1800","diff_url":"https://github.com/jenkinsci/jenkins/pull/1800.diff","patch_url":"https://github.com/jenkinsci/jenkins/pull/1800.patch"},"body":"This changes Jenkins' strategy when doing recursive deletes so that it no longer stops iterating through a directory when it finds a file it can't delete - it'll try to delete what it can before throwing the exception.\r\nIt also changes the default number of attempts that Jenkins makes when doing a recursive delete from 2 attempts to 3 attempts.\r\nThis combination results in a dramatic improvement in deletion reliability on Windows-based job executors.\r\n\r\nThis behavior is configurable (on a per-JVM basis), albeit crudely - like the existing hudson.Util.noSymlink & hudson.Util.symlinkEscapeHatch flags, these can be configured using -D options when starting the Jenkins or slave services.\r\n\r\n-Dhudson.Util.deletionMax=3\r\nSets the number of times Jenkins will try to delete a file before giving up.\r\nDefaults to 3 attempts.\r\n\r\n-Dhudson.Util.deletionRetryWait=100\r\nSets the time (in milliseconds) for which Jenkins will pause between delete attempts.\r\nDefaults to 100ms between each attempt.\r\nIf set to a negative number, it will delay for a linearly increasing amount between attempts.\r\n\r\n-Dhudson.Util.performGCOnFailedDelete=false\r\nIf set to true, this tells Jenkins to run the Garbage Collector between attempts (just in case the process holding a file open is an un-garbage-collected Java filehandle within Jenkins itself).\r\nIt defaults to false.\r\n\r\n(Note: This was reworked to patch the Jenkins master branch as of 15:30 GMT Aug 17 2015, and superceeds pull request 1209)"},"comment":{"url":"https://api.github.com/repos/jenkinsci/jenkins/issues/comments/149186345","html_url":"https://github.com/jenkinsci/jenkins/pull/1800#issuecomment-149186345","issue_url":"https://api.github.com/repos/jenkinsci/jenkins/issues/1800","id":149186345,"user":{"login":"jtnord","id":494726,"avatar_url":"https://avatars.githubusercontent.com/u/494726?v=3","gravatar_id":"","url":"https://api.github.com/users/jtnord","html_url":"https://github.com/jtnord","followers_url":"https://api.github.com/users/jtnord/followers","following_url":"https://api.github.com/users/jtnord/following{/other_user}","gists_url":"https://api.github.com/users/jtnord/gists{/gist_id}","starred_url":"https://api.github.com/users/jtnord/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtnord/subscriptions","organizations_url":"https://api.github.com/users/jtnord/orgs","repos_url":"https://api.github.com/users/jtnord/repos","events_url":"https://api.github.com/users/jtnord/events{/privacy}","received_events_url":"https://api.github.com/users/jtnord/received_events","type":"User","site_admin":false},"created_at":"2015-10-19T11:08:20Z","updated_at":"2015-10-19T11:08:20Z","body":"@pjdarton What I was asking is is there issues where this occurs so that we can look at fixing the root issues rather than masking the issue (and potentially having falky builds).  \r\n\r\nIf a full GC solves the issue then a plugin or core has not closed the file after using it - so this should be an easy fix if we can narrow this down to the plugins in use.  \r\nExternal tools are a little more complicated - some behave well, and some do not.  We could use some hooks to find out what that tool is (given we know the file path) and file upstream issues (if that tool is designed to live outside the build).  The other suspect area would be workspace browsing or SCMs which require the workspace for polling."}}