From ec6ea9b4038b9bc2ac16bda0e34e52a8e8b9ca9a Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Fri, 6 Oct 2017 09:15:45 +0200 Subject: [PATCH] Add Netty channel information on write and flush failure --- .../org/elasticsearch/transport/netty4/Netty4Transport.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Transport.java b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Transport.java index 6eb2e9a7e94..c69b4da17ac 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Transport.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Transport.java @@ -322,7 +322,8 @@ public class Netty4Transport extends TcpTransport { } else { final Throwable cause = f.cause(); Netty4Utils.maybeDie(cause); - logger.warn("write and flush on the network layer failed", cause); + logger.warn((Supplier) () -> + new ParameterizedMessage("write and flush on the network layer failed (channel: [])", channel), cause); assert cause instanceof Exception; listener.onFailure((Exception) cause); }