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

Remove SingleInflight support from Client #1454

Merged
merged 2 commits into from Apr 27, 2023

Conversation

tmthrgd
Copy link
Collaborator

@tmthrgd tmthrgd commented Apr 18, 2023

Callers should instead implement their own in flight query caching.

Closes #1449

Callers should instead implement their own in flight query caching.
@tmthrgd tmthrgd requested a review from miekg as a code owner April 18, 2023 03:13
client.go Outdated
// time.
//
// Deprecated: This is a no-op. Callers should implement their own in flight
// query caching.
Copy link
Owner

Choose a reason for hiding this comment

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

maybe link to the issue for some more background on why?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Will go doc properly linkify it in the form I've added? Do you know?

Copy link
Owner

Choose a reason for hiding this comment

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

lol, we have both forms already:

reverse.go:	// Preserve previous NOTIMP typo, see github.com/miekg/dns/issues/733.
dns_test.go:	tkey.Hdr.Class = ClassINET // https://github.com/miekg/dns/issues/577

except these are not part of the public docs.

I thought you can make pkg.go.dev look at a specific commit but my go gets fail with unknown revision, either way, folks can find the issue regardless of this being linkified

@miekg miekg merged commit c454332 into miekg:master Apr 27, 2023
4 checks passed
@tmthrgd tmthrgd deleted the no_singleinflight branch April 27, 2023 08:24
andrew-d added a commit to andrew-d/dns that referenced this pull request May 10, 2023
If we want to use a custom mechanism of obtaining a Conn that doesn't
match the net.Dialer type, but retain the timeout behaviour from
ExchangeContext, there was previously no way to accomplish this.

This PR makes the underlying ExchangeWithConnContext function public,
which allows this behaviour.

Now that miekg#1454 is merged, there is no longer any interaction between the
context provided and the singleflight behaviour, so I removed the
comment from ExchangeWithConn.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
miekg pushed a commit that referenced this pull request Jun 19, 2023
If we want to use a custom mechanism of obtaining a Conn that doesn't
match the net.Dialer type, but retain the timeout behaviour from
ExchangeContext, there was previously no way to accomplish this.

This PR makes the underlying ExchangeWithConnContext function public,
which allows this behaviour.

Now that #1454 is merged, there is no longer any interaction between the
context provided and the singleflight behaviour, so I removed the
comment from ExchangeWithConn.

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
@jsha
Copy link
Contributor

jsha commented Sep 6, 2023

It's worth noting that if someone was relying on this for birthday attack prevention (https://datatracker.ietf.org/doc/html/rfc5452#section-5), they will no longer be protected, starting from v1.1.54, unless they implement their own protection. Probably instead of "Callers should implement their own in flight query caching if needed" the comment should warn about birthday attacks and encourage callers more strongly to implement their own.

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

Successfully merging this pull request may close these issues.

singleInFlight can cause all future DNS requests to fail
3 participants