-
Notifications
You must be signed in to change notification settings - Fork 232
Make UdpSender lazy to be able to recover from early DNS issues #726
Make UdpSender lazy to be able to recover from early DNS issues #726
Conversation
Not entirely sure what would be the right action for that failing test. It seems to have relied on the UdpSender failing during initialization. If we want to keep it that way, we'd have to eagerly trigger the instantiation of the thrift tranport. I have various ways in my hand on how to do that, but I'd prefer not to unless necessary. |
@yurishkuro @pavolloffay it seems like the project is a little inactive right now, or is this simply the wrong place for such a change request? |
@pschichtel Sorry for the delay in looking at this.
I think it would be fine to change the test to check return value is |
I wonder if this is going to fix the more fundamental issue where the agent address may simply change, e.g. due to agent restart. There was a recent change in the Go client that implemented periodic reconnects: jaegertracing/jaeger-client-go#520 |
Codecov Report
@@ Coverage Diff @@
## master #726 +/- ##
=========================================
Coverage 88.76% 88.76%
Complexity 596 596
=========================================
Files 73 73
Lines 2242 2242
Branches 289 289
=========================================
Hits 1990 1990
Misses 159 159
Partials 93 93 Continue to review full report at Codecov.
|
Updated the commit to fix the test. @yurishkuro In its current state, this PR will not handle an address change. Once the client has successfully been created, that instance will stay the same. However adding on some kind of periodic rechecking and/or error handling in UdpSender#send should not be hard as a follow-up. |
@jpkrohling do you still think we should introduce a configuration option? |
The change in that unit test makes me wonder... Would this change break some kind of fallback logic somewhere? It seems that was being tested there. |
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.
What happens when the agent isn't available and the client keeps trying to send data? Will there be multiple stacktraces in the logs, one per batch? If so, then we definitely need to make this opt-in.
jaeger-thrift/src/main/java/io/jaegertracing/thrift/internal/senders/UdpSender.java
Outdated
Show resolved
Hide resolved
jaeger-thrift/src/test/java/io/jaegertracing/thrift/internal/senders/UdpLazinessTest.java
Outdated
Show resolved
Hide resolved
What about only printing the first stacktrace or every n-th or once every n minutes ? |
First stacktrace + positive confirmation once it succeeds sounds good to me. |
this should close #369 Signed-off-by: Phillip Schichtel <phillip@schich.tel>
I incorporated the suggestions, however I'm not entirely clear on where to handle the logging. I don't think the UdpSender should just swallow the exceptions, I'd say this should be handled at a higher level. I looked at the HttpSender as well and both of them fail in the same way now with this PR: Exception on every call. So any solution should be at a common code path. Either way I'm not sure this is something that should be done in this PR. |
I expect the Reporter to catch the exceptions, since it processes items off a queue from a background thread, so there's nowhere to re-throw them. |
Agree that this shouldn't be done in this PR. Would you please open an issue with this idea? |
So I think we are done here, right? |
Follow up about the logging can be found at #729 |
this should close #369
Which problem is this PR solving?
Short description of the changes