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

net/dnscache: use parent context to perform lookup #11935

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

kylecarbs
Copy link
Contributor

Seemingly no reason why it wasn't used.

kylecarbs added a commit to coder/tailscale that referenced this pull request Apr 30, 2024
kylecarbs added a commit to coder/tailscale that referenced this pull request Apr 30, 2024
@andrew-d andrew-d self-assigned this May 3, 2024
@andrew-d
Copy link
Member

andrew-d commented May 3, 2024

@kylecarbs mind adding a Signed-off-by line to this commit? git commit --amend --signoff should do it 😄

@kylecarbs
Copy link
Contributor Author

I have forgotten to do that so many times it's embarrassing! Yes, will do.

andrew-d added a commit that referenced this pull request May 4, 2024
This is a variant of DoChan that supports context propagation, such that
the context provided to the inner function will only be canceled when
there are no more waiters for a given key. This can be used to
deduplicate expensive and cancelable calls among multiple callers
safely.

Updates #11935

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: Ibe1fb67442a854babbc6924fd8437b02cc9e7bcf
@andrew-d
Copy link
Member

andrew-d commented May 4, 2024

I took a look through this code, and I think the reason is that if the first call is canceled, other callers (that are still waiting) also see a spurious context cancelation since the first call canceled. I've submitted #12003 with a tweak to our singleflight package that supports proper context cancelation, which could be used here.

I'll keep you posted.

Seemingly no reason why it wasn't used.

Signed-off-by: Kyle Carberry <kyle@carberry.com>
andrew-d added a commit that referenced this pull request May 7, 2024
This is a variant of DoChan that supports context propagation, such that
the context provided to the inner function will only be canceled when
there are no more waiters for a given key. This can be used to
deduplicate expensive and cancelable calls among multiple callers
safely.

Updates #11935

Signed-off-by: Andrew Dunham <andrew@du.nham.ca>
Change-Id: Ibe1fb67442a854babbc6924fd8437b02cc9e7bcf
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.

None yet

2 participants