Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust logging in IdleTimeoutInitializer #2289

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
/**
* Initializes the channel with idle timeout handling.
*/
public class IdleTimeoutInitializer implements ChannelInitializer {
public class IdleTimeoutInitializer implements ChannelInitializer { // FIXME: 0.43 - make this class final

private static final Logger LOGGER = LoggerFactory.getLogger(IdleTimeoutInitializer.class);

Expand Down Expand Up @@ -60,7 +60,7 @@ public IdleTimeoutInitializer(long idleTimeoutMillis) {

@Override
public void init(Channel channel) {
LOGGER.debug("Channel idle timeout is {}ms.", timeoutMs);
LOGGER.debug("{} Connection idle timeout is set to {}ms.", channel, timeoutMs);
channel.pipeline().addLast(new IdleStateHandler(0, 0, timeoutMs, TimeUnit.MILLISECONDS) {
@Override
protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) {
Expand All @@ -69,7 +69,7 @@ protected void channelIdle(ChannelHandlerContext ctx, IdleStateEvent evt) {
// and we don't want the idle timeout to fire again during this process.
ctx.pipeline().remove(this);
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Closing channel {} after {}ms of inactivity.", ctx.channel(), timeoutMs);
LOGGER.debug("{} Closing idle connection after {}ms of inactivity.", ctx.channel(), timeoutMs);
}
// Fire the event through the pipeline so protocols can prepare for the close event.
ctx.fireUserEventTriggered(evt);
Expand Down