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
base: main
Are you sure you want to change the base?
Conversation
@kylecarbs mind adding a |
I have forgotten to do that so many times it's embarrassing! Yes, will do. |
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
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 I'll keep you posted. |
Seemingly no reason why it wasn't used. Signed-off-by: Kyle Carberry <kyle@carberry.com>
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
Seemingly no reason why it wasn't used.