Fix AsynchronousTlsChannelGroup processPendingInterests
Handle when channels are closed with pending operations when
processing pending interests.
@@ -442,7 +442,12 @@ public class AsynchronousTlsChannelGroup {
RegisteredSocket socket = (RegisteredSocket) key.attachment();
int pending = socket.pendingOps.getAndSet(0);
if (pending != 0) {
+ try {
key.interestOps(key.interestOps() | pending);
+ } catch (CancelledKeyException e) {
+ // can happen when channels are closed with pending operations
+ break;
+ }
}
}
}
