Log Selector instance when Selector needs to be rebuild
Motivation: To better debug why a Selector need to be rebuild it is useful to also log the instance of the Selector. Modifications: Add logger instance to the log message. Result: More useful log message.
This commit is contained in:
parent
8af84bb60e
commit
0dee98a7fc
@ -716,8 +716,8 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
||||
// The selector returned prematurely many times in a row.
|
||||
// Rebuild the selector to work around the problem.
|
||||
logger.warn(
|
||||
"Selector.select() returned prematurely {} times in a row; rebuilding selector.",
|
||||
selectCnt);
|
||||
"Selector.select() returned prematurely {} times in a row; rebuilding Selector {}.",
|
||||
selectCnt, selector);
|
||||
|
||||
rebuildSelector();
|
||||
selector = this.selector;
|
||||
@ -733,12 +733,14 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
||||
|
||||
if (selectCnt > MIN_PREMATURE_SELECTOR_RETURNS) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug("Selector.select() returned prematurely {} times in a row.", selectCnt - 1);
|
||||
logger.debug("Selector.select() returned prematurely {} times in a row for Selector {}.",
|
||||
selectCnt - 1, selector);
|
||||
}
|
||||
}
|
||||
} catch (CancelledKeyException e) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
logger.debug(CancelledKeyException.class.getSimpleName() + " raised by a Selector - JDK bug?", e);
|
||||
logger.debug(CancelledKeyException.class.getSimpleName() + " raised by a Selector {} - JDK bug?",
|
||||
selector, e);
|
||||
}
|
||||
// Harmless exception - log anyway
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user