Skip to content

delegatingresolver: Call ResolveNow in a new goroutine to avoid deadlocks #8199

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

Conversation

arjan-bal
Copy link
Contributor

While handling updates from child resolvers, the delegating resolver locks it's mutex. If the channel returns an error on updating the state, the delegating resolver calls ResolveNow on the other child. This can result in a deadlock if the other child attempts to call cc.UpdateState synchronously while handling the ResolveNow call. This change makes delegatingResovler call ResolveNow in a new goroutine to avoid such deadlocks.

RELEASE NOTES:

  • resolver/delegatingresolver: Avoid deadlocks when an http proxy is configured and a resolver calls UpdateState synchronously while handling a ResolveNow call.

@arjan-bal arjan-bal added Type: Bug Area: Resolvers/Balancers Includes LB policy & NR APIs, resolver/balancer/picker wrappers, LB policy impls and utilities. labels Mar 25, 2025
@arjan-bal arjan-bal added this to the 1.71 Release milestone Mar 25, 2025
Copy link

codecov bot commented Mar 25, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.07%. Comparing base (b0d1203) to head (e15d5a2).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #8199   +/-   ##
=======================================
  Coverage   82.06%   82.07%           
=======================================
  Files         410      410           
  Lines       40233    40218   -15     
=======================================
- Hits        33018    33008   -10     
  Misses       5854     5854           
+ Partials     1361     1356    -5     
Files with missing lines Coverage Δ
.../resolver/delegatingresolver/delegatingresolver.go 80.00% <100.00%> (+3.31%) ⬆️

... and 32 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@arjan-bal arjan-bal closed this Mar 25, 2025
@arjan-bal
Copy link
Contributor Author

Changes merged into #8195 since all non-test code changes were common.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Resolvers/Balancers Includes LB policy & NR APIs, resolver/balancer/picker wrappers, LB policy impls and utilities. Type: Bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants