Skip to content
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

feat: context-based tracing to record delayed DNS responses #870

Merged
merged 8 commits into from Aug 22, 2022

Conversation

DecFox
Copy link
Collaborator

@DecFox DecFox commented Aug 21, 2022

Checklist

Description

This diff simplifies the existing implementation of the DNSOverUDP transport by migrating core functionality to the RoundTrip enabling the use of a background routine to record delayed DNS responses. This also allows us to make use of context-based tracing to record delayed responses.

@DecFox DecFox changed the title feat: simplify DNSOverUDP and allow recording delayed responses using… feat: introduce context-based tracing to record delayed DNS responses Aug 21, 2022
@DecFox DecFox changed the title feat: introduce context-based tracing to record delayed DNS responses feat: context-based tracing to record delayed DNS responses Aug 21, 2022
1. we can use the same function for constructing a new Archival DNS
lookup result as long as we abstract over the type passed to the
constructor, which only needs to include Address and Network;

2. rename the function to drain from the trace to make it more
explicit that we need a timeout using a context;

3. improve documentation of late response callback's args;

4. ensure we own the connection and avoid reporting errors in the
sendrecv loop, which we actually don't care of.
Now the caller has to pass a context and a timeout and both concur
to decide when to stop reading.

Additionally, recognize that channel selection is nondeterministic and
make sure we fully drain from the channel if the context expires and the
channel still happens to continue to be readable.
@DecFox DecFox marked this pull request as ready for review August 22, 2022 11:45
Copy link
Member

@bassosimone bassosimone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐳

Thank you!

(FTR, I pushed some extra changes for correctness and asked @DecFox out of band to check whether my extra changes were okay)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants