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

can not disable the retries of Util.delete

    Details

    • Similar Issues:
    • Released As:
      Jenkins 2.210

      Description

      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)); 

       
      and the PathRemover]..

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

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

        Attachments

          Activity

          teilo James Nord created issue -
          teilo James Nord made changes -
          Field Original Value New Value
          Description [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]]
          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}
           
          [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}
           
          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}
          teilo James Nord made changes -
          Description [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}
           
          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}
          [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}
           
           and the [PathRemover|#L64]]..
          {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.
          teilo James Nord made changes -
          Assignee James Nord [ teilo ]
          teilo James Nord made changes -
          Status Open [ 1 ] In Progress [ 3 ]
          teilo James Nord made changes -
          Labels lts-candidate
          teilo James Nord made changes -
          Status In Progress [ 3 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          oleg_nenashev Oleg Nenashev made changes -
          Released As Jenkins 2.210
          olivergondza Oliver Gondža made changes -
          Labels lts-candidate 2.204.2-fixed

            People

            • Assignee:
              teilo James Nord
              Reporter:
              teilo James Nord
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: