-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[c-ares] fix spin loop bug when c-ares gives up on a socket that stil…
…l has data left in its read buffer (grpc#34185) If we get a readable event on an fd and both the following happens: - c-ares does *not* read all bytes off the fd - c-ares removes the fd from the set ARES_GETSOCK_READABLE ... then we have a busy loop here, where we'd keep asking c-ares to process an fd that it no longer cares about. This is indirectly related to a change in this code one month ago: grpc#33942 - before that change, c-ares would close the socket when it called [handle_error](https://github.com/c-ares/c-ares/blob/7f3262312f246556d8c1bdd8ccc1844847f42787/src/lib/ares_process.c#L707) and so `IsFdStillReadableLocked` would start returning `false`, causing us to get away with [this loop](https://github.com/grpc/grpc/blob/f6a994229e72bc771963706de7a0cd8aa9150bb6/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc#L371). Now, because `IsFdStillReadableLocked` will keep returning true (because of our overridden `close` API), we'll loop forever.
- Loading branch information
Showing
4 changed files
with
105 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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