Skip to content

Commit

Permalink
catch CancelledKeyException when debug logging in EventLoop (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
kortemik authored May 14, 2024
1 parent d220677 commit 3f0cfc7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/main/java/com/teragrep/rlp_03/eventloop/EventLoop.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,15 @@ public void poll() throws IOException {
Set<SelectionKey> selectionKeys = selector.selectedKeys();
LOGGER.debug("selectionKeys <{}> ", selectionKeys);
for (SelectionKey selectionKey : selectionKeys) {
if (LOGGER.isDebugEnabled()) {
LOGGER
.debug(
"selectionKey <{}>: isValid <{}>, isConnectable <{}>, isAcceptable <{}>, isReadable <{}>, isWritable <{}>",
selectionKey, selectionKey.isValid(), selectionKey.isConnectable(),
selectionKey.isAcceptable(), selectionKey.isReadable(), selectionKey.isWritable()
);
}

try {
if (LOGGER.isDebugEnabled()) {
LOGGER
.debug(
"selectionKey <{}>: isValid <{}>, isConnectable <{}>, isAcceptable <{}>, isReadable <{}>, isWritable <{}>",
selectionKey, selectionKey.isValid(), selectionKey.isConnectable(),
selectionKey.isAcceptable(), selectionKey.isReadable(), selectionKey.isWritable()
);
}
if (selectionKey.isAcceptable()) {
// ListenContext
ListenContext listenContext = (ListenContext) selectionKey.attachment();
Expand Down

0 comments on commit 3f0cfc7

Please sign in to comment.