Cancel c-ares queries after a timeout to avoid getting stuck#17354
Merged
apolcyn merged 1 commit intogrpc:masterfrom Dec 1, 2018
Merged
Cancel c-ares queries after a timeout to avoid getting stuck#17354apolcyn merged 1 commit intogrpc:masterfrom
apolcyn merged 1 commit intogrpc:masterfrom
Conversation
|
|
|
|
markdroth
reviewed
Nov 30, 2018
Member
markdroth
left a comment
There was a problem hiding this comment.
Having a timeout here seems like a good idea. Just a couple of comments about the implementation.
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
Outdated
Show resolved
Hide resolved
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
Outdated
Show resolved
Hide resolved
|
1 similar comment
|
|
markdroth
reviewed
Nov 30, 2018
Member
markdroth
left a comment
There was a problem hiding this comment.
Looks good, just a few minor comments.
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc
Outdated
Show resolved
Hide resolved
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver.cc
Outdated
Show resolved
Hide resolved
|
|
|
|
1 similar comment
|
|
markdroth
reviewed
Nov 30, 2018
|
|
|
Contributor
Author
|
thanks for the review! |
|
|
|
|
|
667010b to
b203ed3
Compare
|
|
|
|
|
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The background for this is there is a multi-channel benchmark involving a large number of channels that connect to a grpclb-in-DNS based benchmark service. Frequently, this benchmark actually fails to run because one or more client channels fails to connect (reach "channel connectivtity state == ready") to the benchmark backend within a 3-and-half minute timeout. I found that when this happens, there is at least one c-ares fd notify on read without a matching on_readable; at least one DNS query gets stuck. Currently, this makes a channel effectively stuck for the rest of its lifetime because there aren't any effective deadline for UDP queries made by c-ares. But I think this is just an inherent problem with UDP/DNS queries that they risk being dropped. By cancelling queries after a reasonable timeout, channels can retry them and become unstuck.
This PR is a draft (I'm not sure if the 10 second timeout is best), but I've verified that this change fixes the problem in the benchmark.