@@ -234,12 +234,15 @@ public V get(long l, TimeUnit tu) throws InterruptedException, TimeoutException,
234
234
TimeoutException te = new TimeoutException (String .format ("No response received after %s %s" , l , tu .name ().toLowerCase ()));
235
235
if (!throwableCalled .getAndSet (true )) {
236
236
try {
237
- asyncHandler .onThrowable (te );
238
- } catch (Throwable t ) {
239
- logger .debug ("asyncHandler.onThrowable" , t );
237
+ try {
238
+ asyncHandler .onThrowable (te );
239
+ } catch (Throwable t ) {
240
+ logger .debug ("asyncHandler.onThrowable" , t );
241
+ }
242
+ throw new ExecutionException (te );
243
+ } finally {
244
+ cancelReaper ();
240
245
}
241
- cancelReaper ();
242
- throw new ExecutionException (te );
243
246
}
244
247
}
245
248
isDone .set (true );
@@ -267,12 +270,15 @@ private V getContent() throws ExecutionException {
267
270
} catch (Throwable ex ) {
268
271
if (!throwableCalled .getAndSet (true )) {
269
272
try {
270
- asyncHandler .onThrowable (ex );
271
- } catch (Throwable t ) {
272
- logger .debug ("asyncHandler.onThrowable" , t );
273
+ try {
274
+ asyncHandler .onThrowable (ex );
275
+ } catch (Throwable t ) {
276
+ logger .debug ("asyncHandler.onThrowable" , t );
277
+ }
278
+ throw new RuntimeException (ex );
279
+ } finally {
280
+ cancelReaper ();
273
281
}
274
- cancelReaper ();
275
- throw new RuntimeException (ex );
276
282
}
277
283
}
278
284
content .compareAndSet (null , update );
0 commit comments