TSFenwick commented on PR #14776:
URL: https://github.com/apache/druid/pull/14776#issuecomment-1670429813

   My issue is that with the retry utils you lose the actual exception which is 
needed to understand which file couldn't be deleted
   
   ```
   while (!Thread.currentThread().isInterrupted()) {
         try {
           nTry++;
           return f.perform();
         }
         catch (Throwable e) {
           if (cleanupAfterFailure != null) {
             cleanupAfterFailure.cleanup();
           }
           if (nTry < maxTries && shouldRetry.apply(e)) {
             if (!skipSleep) {
               awaitNextRetry(e, messageOnRetry, nTry, maxRetries, nTry <= 
quietTries);
             }
           } else {
             Throwables.propagateIfInstanceOf(e, Exception.class);
             throw new RuntimeException(e);
           }
         }
       }
   ```
   
   ```
     public static <X extends Throwable> void propagateIfInstanceOf(@Nullable 
Throwable throwable, Class<X> declaredType) throws X {
       if (throwable != null && declaredType.isInstance(throwable)) {
         throw (Throwable)declaredType.cast(throwable);
       }
     }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to