Fix NullPointerException in transport trace logger#132243
Fix NullPointerException in transport trace logger#132243elasticsearchmachine merged 9 commits intoelastic:mainfrom
NullPointerException in transport trace logger#132243Conversation
DaveCTurner
left a comment
There was a problem hiding this comment.
I think we should also fix the NPE you found. I see no reason to even call openOrGetStreamInput() within this format method.
|
Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination) |
Yes, I also removed unused |
DaveCTurner
left a comment
There was a problem hiding this comment.
Looks good, could we also have a test covering this case in org.elasticsearch.transport.TransportLoggerTests?
Sure, I am going to add a test case. |
|
Original report: IssueWhen trace-level logging is enabled, a node might disconnect from cluster due to an NPE that causes the transport connection closed between the data node and the master node. InboundMessages printed by ResolveWe should only print warn logs instead of throwing NPE to caused connection closed between nodes. So try to catch all the exceptions instead of |
|
@elasticmachine test this please |
|
@elasticmachine test this please |
|
@elasticmachine test this please |
When trace-level logging is enabled, a node might disconnect from
cluster due to an NPE that causes the transport connection closed
between the data node and the master node.
InboundMessages printed by
TransportLoggermight throw an NPE in theformat function because
contentmight be NULL if another node sends anabnormal exception response.
Also there's no good reason to close the connection because of a logging
exception, so with this commit we catch all exceptions (rather than just
IOException)