Skip to content

Commit

Permalink
Log WARN on Response Deserialization Failure (elastic#62368)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
original-brownbear authored Sep 15, 2020
1 parent 953536b commit 9a9cb06
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,10 @@ private <T extends TransportResponse> void handleResponse(InetSocketAddress remo
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();
Expand Down

0 comments on commit 9a9cb06

Please sign in to comment.