Skip to content

Commit

Permalink
Retry TimeoutException in azure file system
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman committed Sep 9, 2023
1 parent 79c677a commit fb07397
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import java.nio.file.WatchService
import java.nio.file.attribute.UserPrincipalLookupService
import java.time.Duration
import java.time.temporal.ChronoUnit
import java.util.concurrent.TimeoutException
import java.util.function.Predicate

import com.azure.core.util.polling.SyncPoller
Expand Down Expand Up @@ -552,7 +553,7 @@ class AzFileSystem extends FileSystem {
* @return The result of the supplied action
*/
protected <T> T apply(CheckedSupplier<T> action) {
final policy = retryPolicy((Throwable t) -> t instanceof IOException || t.cause instanceof IOException)
final policy = retryPolicy((Throwable t) -> t instanceof IOException || t.cause instanceof IOException || t instanceof TimeoutException)
return Failsafe.with(policy).get(action)
}
}

0 comments on commit fb07397

Please sign in to comment.