Browse Source

Log WARN on Response Deserialization Failure (#62368)

We never see this exception in the logs even though it's pretty severe.
All we might see is an exception about a transport message not having been read fully
from the logic that follows this code.
Technically we should probably bubble up the exception but that's a bigger change
and needs some carefully reasoning, this change for the time being at least simplifies
tracking down deserialization issues in responses.
Armin Braun 5 years ago
parent
commit
9a9cb06916

+ 4 - 2
server/src/main/java/org/elasticsearch/transport/InboundHandler.java

@@ -219,8 +219,10 @@ public class InboundHandler {
             response = handler.read(stream);
             response.remoteAddress(new TransportAddress(remoteAddress));
         } catch (Exception e) {
-            handleException(handler, new TransportSerializationException(
-                    "Failed to deserialize response from handler [" + handler + "]", e));
+            final Exception serializationException = new TransportSerializationException(
+                    "Failed to deserialize response from handler [" + handler + "]", e);
+            logger.warn(new ParameterizedMessage("Failed to deserialize response from [{}]", remoteAddress), serializationException);
+            handleException(handler, serializationException);
             return;
         }
         final String executor = handler.executor();