Skip to content

Commit 8392375

Browse files
committed
Make sure HashedWheelTimer is closed even when ChannelManager.close crashes
1 parent 8f99713 commit 8392375

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

client/src/main/java/org/asynchttpclient/DefaultAsyncHttpClient.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,15 @@ public void close() {
9494
if (closed.compareAndSet(false, true)) {
9595
try {
9696
channelManager.close();
97-
98-
if (allowStopNettyTimer)
99-
nettyTimer.stop();
100-
10197
} catch (Throwable t) {
102-
LOGGER.warn("Unexpected error on close", t);
98+
LOGGER.warn("Unexpected error on ChannelManager close", t);
99+
}
100+
if (allowStopNettyTimer) {
101+
try {
102+
nettyTimer.stop();
103+
} catch (Throwable t) {
104+
LOGGER.warn("Unexpected error on HashedWheelTimer close", t);
105+
}
103106
}
104107
}
105108
}

0 commit comments

Comments
 (0)