-
Notifications
You must be signed in to change notification settings - Fork 149
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
add check for timeout exception #76
Conversation
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.
Why do we want to special case this? I fully grok what it's doing, but I don't immediately see why this is desirable.
I also asked for a small/nitpicky change.
/** | ||
* Detects if the error received was a connection timeout exception. This can happen if the agent hasn't sent any spans for more than 15 seconds. | ||
*/ | ||
protected boolean isConnectionTimeoutException(Throwable t) { |
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.
If this is protected only for the test to have access, let's make it package-private and add a comment or annotation saying that it's available just for testing.
disconnectionHandler, shouldRecreateCall); | ||
|
||
Throwable exception = new StatusRuntimeException(Status.fromCode(Status.Code.INTERNAL).withDescription("No error: A GRPC status of OK should have been sent\nRst Stream")); | ||
assertTrue(target.isConnectionTimeoutException(exception)); |
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.
There are a few permutations that are missing from the test suite:
- type is not a
StatusRuntimeException
(tho it might be tested above/below, I didn't check) - type IS
StatusRuntimeException
but the message doesn't match.
Would be nice to have proper coverage of the new behavior.
What happens is after 15 seconds if we don't send anything to infinite tracing it closes the channel and sends us an ugly exception that we print to the logs as a WARNING. The agent simply reconnect after that and there's nothing wrong with that, that's just how it is handled. We don't want to scare customers with this log message when nothing is actually wrong. So far it has scared customers into filing tickets with us. We special case this error because we don't want to avoid printing other errors that may occur which are actually serious. |
Ok cool, thanks for the clarification. |
Also manually tested and works.