Remove extra checks to fix #9456 (#9523)

Motivation:

There are some extra log level checks (logger.isWarnEnabled()).

Modification:

Remove log level checks (logger.isWarnEnabled()) from io.netty.channel.epoll.AbstractEpollStreamChannel, io.netty.channel.DefaultFileRegion, io.netty.channel.nio.AbstractNioChannel, io.netty.util.HashedWheelTimer, io.netty.handler.stream.ChunkedWriteHandler and io.netty.channel.udt.nio.NioUdtMessageConnectorChannel

Result:

Fixes #9456
This commit is contained in:
Xiaoqin Fu 2019-08-30 01:37:30 -07:00 committed by Norman Maurer
parent 8910d62544
commit 88aa12cc1a
5 changed files with 5 additions and 15 deletions

View File

@ -266,10 +266,8 @@ public class HashedWheelTimer implements Timer {
}
if (duration < MILLISECOND_NANOS) {
if (logger.isWarnEnabled()) {
logger.warn("Configured tickDuration {} smaller then {}, using 1ms.",
logger.warn("Configured tickDuration {} smaller then {}, using 1ms.",
tickDuration, MILLISECOND_NANOS);
}
this.tickDuration = MILLISECOND_NANOS;
} else {
this.tickDuration = duration;

View File

@ -111,9 +111,7 @@ public class ChunkedWriteHandler implements ChannelHandler {
try {
doFlush(ctx);
} catch (Exception e) {
if (logger.isWarnEnabled()) {
logger.warn("Unexpected exception while sending chunks.", e);
}
logger.warn("Unexpected exception while sending chunks.", e);
}
}

View File

@ -669,9 +669,7 @@ public abstract class AbstractEpollStreamChannel extends AbstractEpollChannel im
try {
fd.close();
} catch (IOException e) {
if (logger.isWarnEnabled()) {
logger.warn("Error while closing a pipe", e);
}
logger.warn("Error while closing a pipe", e);
}
}
}

View File

@ -158,9 +158,7 @@ public class DefaultFileRegion extends AbstractReferenceCounted implements FileR
try {
file.close();
} catch (IOException e) {
if (logger.isWarnEnabled()) {
logger.warn("Failed to close a file.", e);
}
logger.warn("Failed to close a file.", e);
}
}

View File

@ -80,10 +80,8 @@ public abstract class AbstractNioChannel extends AbstractChannel {
try {
ch.close();
} catch (IOException e2) {
if (logger.isWarnEnabled()) {
logger.warn(
logger.warn(
"Failed to close a partially initialized socket.", e2);
}
}
throw new ChannelException("Failed to enter non-blocking mode.", e);