[JIRA] (JENKINS-60351) can not disable the retries of Util.delete

0 views
Skip to first unread message

jnord@cloudbees.com (JIRA)

unread,
Dec 3, 2019, 9:24:02 AM12/3/19
to jenkinsc...@googlegroups.com
James Nord created an issue
 
Jenkins / Bug JENKINS-60351
can not disable the retries of Util.delete
Issue Type: Bug Bug
Assignee: Unassigned
Components: core
Created: 2019-12-03 14:23
Priority: Minor Minor
Reporter: James Nord

https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/hudson/Util.java#L1581-L1596 is confused.

 

The properties is for "retries" which you should be able to disable with a count of zero. but you can not. but the comment implies it is just for the number of tries (not retries).

However the code calls PathRemover.newFilteredRobustRemover(pathChecker, DELETION_MAX - 1, GC_AFTER_FAILED_DELETE, WAIT_BETWEEN_DELETION_RETRIES);
which ends up in https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/jenkins/util/io/PathRemover.java#L63-L65  which is using a max retries.

However if you run a test with the system property set to one.  then you do get one retry not one try.

-DargLine=-Dhudson.Util.maxFileDeletionRetries=1

 

 Unable to delete 'C:\Users\IEUser\Desktop\oc-server\target\tmp\j h6725733765603761727'. Tried 2 time (of a maximum of 2) waiting 0.1 sec between attempts. 

so the property does seem to be acting as a retry despite the code comment but you can not set it to zero one because...

static int DELETION_MAX = Math.max(1, SystemProperties.getInteger(Util.class.getName() + ".maxFileDeletionRetries", 3)); 

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

jnord@cloudbees.com (JIRA)

unread,
Dec 3, 2019, 9:28:07 AM12/3/19
to jenkinsc...@googlegroups.com
James Nord updated an issue
Change By: James Nord
[https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/hudson/Util.java#L1581-L1596] is confused.

 

The properties is for "retries" which you should be able to disable with a count of zero. but you can not. but the comment implies it is just for the number of tries (not retries).

However the code calls [{{PathRemover.newFilteredRobustRemover(pathChecker, DELETION_MAX - 1, GC_AFTER_FAILED_DELETE, WAIT_BETWEEN_DELETION_RETRIES);}}| [https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/hudson/Util.java #L1635]]
However if you run a test with the system property set to one.  then you do get one retry not one try.

-DargLine=-Dhudson.Util.maxFileDeletionRetries=1

 
{noformat}
Unable to delete 'C:\Users\IEUser\Desktop\oc-server\target\tmp\j h6725733765603761727'. Tried 2 time (of a maximum of 2) waiting 0.1 sec between attempts. {noformat}

so the property does seem to be acting as a retry despite the code comment but you can not set it to zero one because...


{noformat}
static int DELETION_MAX = Math.max(1, SystemProperties.getInteger(Util.class.getName() + ".maxFileDeletionRetries", 3)); {noformat}
 

and the [PathRemover|[https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/jenkins/util/io/PathRemover.java#L64]]..


{noformat}
return new PathRemover(new PausingGCRetryStrategy(Math.max(maxRetries, 1), gcAfterFailedRemove, waitBetweenRetries), pathChecker);{noformat}

jnord@cloudbees.com (JIRA)

unread,
Dec 3, 2019, 9:29:03 AM12/3/19
to jenkinsc...@googlegroups.com
James Nord updated an issue
[https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/hudson/Util.java#L1581-L1596] is confused.

 

The properties is for "retries" which you should be able to disable with a count of zero. but you can not. but the comment implies it is just for the number of tries (not retries).

However the code calls [{{PathRemover.newFilteredRobustRemover(pathChecker, DELETION_MAX - 1, GC_AFTER_FAILED_DELETE, WAIT_BETWEEN_DELETION_RETRIES);}}|#L1635]]

which ends up in [https://github.com/jenkinsci/jenkins/blob/c8efc7c78e26f3aefad24ef4c8a161cb9a269ea3/core/src/main/java/jenkins/util/io/PathRemover.java#L63-L65]  which is using a max retries.

However if you run a test with the system property set to one.  then you do get one retry not one try.

-DargLine=-Dhudson.Util.maxFileDeletionRetries=1

 
{noformat}
Unable to delete 'C:\Users\IEUser\Desktop\oc-server\target\tmp\j h6725733765603761727'. Tried 2 time (of a maximum of 2) waiting 0.1 sec between attempts. {noformat}
so the property does seem to be acting as a retry despite the code comment but you can not set it to zero one because...
{noformat}
static int DELETION_MAX = Math.max(1, SystemProperties.getInteger(Util.class.getName() + ".maxFileDeletionRetries", 3)); {noformat}
 


{noformat}
return new PathRemover(new PausingGCRetryStrategy(Math.max(maxRetries, 1), gcAfterFailedRemove, waitBetweenRetries), pathChecker);{noformat}

which means it will always retry once, which is a PITA when trying to some timing bugs.

jnord@cloudbees.com (JIRA)

unread,
Dec 3, 2019, 9:41:02 AM12/3/19
to jenkinsc...@googlegroups.com
James Nord assigned an issue to James Nord
Change By: James Nord
Assignee: James Nord

jnord@cloudbees.com (JIRA)

unread,
Dec 3, 2019, 9:41:02 AM12/3/19
to jenkinsc...@googlegroups.com
James Nord started work on Bug JENKINS-60351
 
Change By: James Nord
Status: Open In Progress

jnord@cloudbees.com (JIRA)

unread,
Dec 18, 2019, 11:32:02 AM12/18/19
to jenkinsc...@googlegroups.com
James Nord updated an issue
Change By: James Nord
Labels: lts-candidate

jnord@cloudbees.com (JIRA)

unread,
Dec 20, 2019, 5:36:02 AM12/20/19
to jenkinsc...@googlegroups.com
James Nord resolved as Fixed
 

marking as lts-candidate not because its bad for users but because it is bad for developers especially with the bump in jenkins-test-harness which fails tests if it can not clear up the temporary directory (which is painful to diagnose if retries kick in) (and more so if you run on windows)

Change By: James Nord
Status: In Progress Resolved
Resolution: Fixed

o.v.nenashev@gmail.com (JIRA)

unread,
Dec 22, 2019, 6:44:02 PM12/22/19
to jenkinsc...@googlegroups.com
Oleg Nenashev updated an issue
Change By: Oleg Nenashev
Released As: Jenkins 2.210

ogondza@gmail.com (JIRA)

unread,
Jan 13, 2020, 1:44:03 PM1/13/20
to jenkinsc...@googlegroups.com
Oliver Gondža updated an issue
Change By: Oliver Gondža
Labels: lts 2.204.2 - candidate fixed
Reply all
Reply to author
Forward
0 new messages