Skip to content

Commit 2e37486

Browse files
committed
Be slightly more defensive when clearing the forkJoinPoolThread ref in DelegatingScheduler
1 parent 19dfd28 commit 2e37486

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/net/jodah/failsafe/internal/util/DelegatingScheduler.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,14 @@ public ScheduledFuture<?> schedule(Callable<?> callable, long delay, TimeUnit un
139139
}
140140
}
141141
promise.complete(callable.call());
142+
} catch (Throwable t) {
143+
promise.completeExceptionally(t);
144+
} finally {
142145
if (isForkJoinPool) {
143146
synchronized (promise) {
144147
promise.forkJoinPoolThread = null;
145148
}
146149
}
147-
} catch (Throwable t) {
148-
promise.completeExceptionally(t);
149150
}
150151
return null;
151152
};

0 commit comments

Comments
 (0)