-
Notifications
You must be signed in to change notification settings - Fork 3.9k
plumb otel subchannel metrics disconnect error #12342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
plumb otel subchannel metrics disconnect error #12342
Conversation
@GuardedBy("this") | ||
void notifyShutdown(Status status) { | ||
clientTransportListener.transportShutdown(status); | ||
clientTransportListener.transportShutdown(status, SimpleDisconnectError.SUBCHANNEL_SHUTDOWN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UNKNOWN ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely isn't SUBCHANNEL_SHUTDOWN. I think it is fair to use UNKNOWN, because the transport would need to be instrumented to know better.
@GuardedBy("this") | ||
void notifyShutdown(Status status) { | ||
clientTransportListener.transportShutdown(status); | ||
clientTransportListener.transportShutdown(status, SimpleDisconnectError.SUBCHANNEL_SHUTDOWN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely isn't SUBCHANNEL_SHUTDOWN. I think it is fair to use UNKNOWN, because the transport would need to be instrumented to know better.
* | ||
*/ | ||
@ThreadSafe | ||
public interface ClientTransportWithDisconnectReason extends ClientTransport { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is only used as part of the KeepAliveManager API, so move it there. And then it would be named relative to that API, like Transport
if within ClientKeepAlivePinger
.
(This is probably the only remaining use of ping() as well, so we'll probably end up moving ping() from ClientTransport to this interface as well, as which point it won't extend ClientTransport.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OkHttpClientTransport and NettyClientTransport will implement it as well....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because they are users of the ClientKeepAlivePinger API...
|
||
@Override | ||
public void shutdownNow(final Status reason) { | ||
shutdownNow(reason, SimpleDisconnectError.UNKNOWN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SUBCHANNEL_SHUTDOWN
@Override | ||
public void run() { | ||
lifecycleManager.notifyShutdown(reason); | ||
lifecycleManager.notifyShutdown(reason, SimpleDisconnectError.SUBCHANNEL_SHUTDOWN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disconnectError
|
||
@Override | ||
public void shutdownNow(Status reason) { | ||
shutdownNow(reason, SimpleDisconnectError.UNKNOWN); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SUBCHANNEL_SHUTDOWN
|
||
@Override | ||
public void shutdownNow(Status reason, DisconnectError disconnectError) { | ||
shutdown(reason); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
disconnectError
looks like it should be passed to be passed to shutdown.
ArgumentCaptor<Status> captor = ArgumentCaptor.forClass(Status.class); | ||
verify(listener, timeout(TIME_OUT_MS)).transportShutdown(captor.capture()); | ||
verify(listener, timeout(TIME_OUT_MS)).transportShutdown(captor.capture(), | ||
any(DisconnectError.class)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably want to consider verifying the DisconnectError as well, for this and the other three below that use captor.capture().
Finishes the remaining work of A94