Skip to content
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

gossip: don't resolve addresses while holding mutex #95426

Merged
merged 1 commit into from
Jan 18, 2023

Conversation

erikgrinaker
Copy link
Contributor

@erikgrinaker erikgrinaker commented Jan 18, 2023

This patch removes a DNS resolution call performed while holding the gossip mutex. This can lead to severe process stalls if the DNS lookup is not immediate, since we need to acquire gossip read locks in several performance critical code paths, including Raft processing. However, the DNS lookup was only done when validating a remote forwarding address, which presumably happens fairly rarely. Removing it should not cause any problems, since the address will necessarily be validated later when attempting to connect to it.

Resolves #95349.

Epic: none
Release note (bug fix): Fixed a bug where a DNS lookup was performed during gossip remote forwarding while holding the gossip mutex. This could cause processing stalls if the DNS server was slow to respond.

This patch removes a DNS resolution call performed while holding the
gossip mutex. This can lead to severe process stalls if the DNS lookup
is not immediate, since we need to acquire gossip read locks in several
performance critical code paths, including Raft processing. However, the
DNS lookup was only done when validating a remote forwarding address,
which presumably happens fairly rarely. Removing it should not cause any
problems, since the address will necessarily be validated later when
attempting to connect to it.

Epic: none
Release note (bug fix): Fixed a bug where a DNS lookup was performed
during gossip remote forwarding while holding the gossip mutex. This
could cause processing stalls if the DNS server was slow to respond.
@erikgrinaker erikgrinaker requested review from tbg and a team January 18, 2023 09:57
@erikgrinaker erikgrinaker self-assigned this Jan 18, 2023
@erikgrinaker erikgrinaker requested a review from a team as a code owner January 18, 2023 09:57
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@erikgrinaker
Copy link
Contributor Author

bors r+

@erikgrinaker
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jan 18, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

gossip: don't resolve addresses under lock
3 participants