make ResolveNow non block #5
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
After #4 , it still cause a lot of goroutines.
In my case the goroutines are blocked at
google.golang.org/grpc.(*ccResolverWrapper).resolveNowfor many hours.In previous PR #4 , I've fixed to return early to avoid multiple calls from
ClientConn.resolveNow, but it blocked inccResolverWrapper.resolveNowand all goroutine is blocked when one goroutine is resolving cloudmap.In this PR, I changed resolver not to block any goroutines referencing dnsResolver in grpc package.