Fix handler name on message not fully read
Today when a message is not fully read on a response, we log (among other details) the handler name. Unfortunately, if the handler is a wrapper, all that we see is o.e.x.s.t.TransportService$ContextRestoreResponseHandler@7446ba18 completely losing the offending handler. This commit adds an override for TransportService$ContextRestoreResponseHandler#toString so that the underlying offender can be discovered. Relates elastic/elasticsearch#4043 Original commit: elastic/x-pack-elasticsearch@3eb1003d5b
This commit is contained in:
parent
0977935989
commit
7da624739d
|
@ -259,6 +259,7 @@ public class SecurityServerTransportInterceptor implements TransportInterceptor
|
|||
* are invoked we restore the context.
|
||||
*/
|
||||
static final class ContextRestoreResponseHandler<T extends TransportResponse> implements TransportResponseHandler<T> {
|
||||
|
||||
private final TransportResponseHandler<T> delegate;
|
||||
private final ThreadContext.StoredContext context;
|
||||
private final ThreadContext threadContext;
|
||||
|
@ -296,5 +297,12 @@ public class SecurityServerTransportInterceptor implements TransportInterceptor
|
|||
public String executor() {
|
||||
return delegate.executor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getClass().getName() + "/" + delegate.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue