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

getaddrinfo: retrying on eai_again #33130

Merged
merged 2 commits into from
Mar 27, 2024
Merged

Conversation

alyssawilk
Copy link
Contributor

@alyssawilk alyssawilk commented Mar 26, 2024

Risk Level: low
Testing: new tests
Docs Changes: n/a
Release Notes: inline
[Optional Runtime guard:] yes

Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #33130 was opened by alyssawilk.

see: more, trace.

Copy link

CC @envoyproxy/runtime-guard-changes: FYI only for changes made to (source/common/runtime/runtime_features.cc).

🐱

Caused by: #33130 was opened by alyssawilk.

see: more, trace.

@alyssawilk alyssawilk assigned abeyad and mattklein123 and unassigned abeyad Mar 26, 2024
@alyssawilk alyssawilk marked this pull request as ready for review March 26, 2024 20:11
abeyad
abeyad previously approved these changes Mar 26, 2024
@@ -157,6 +159,9 @@ class GetAddrInfoDnsResolver : public DnsResolver, public Logger::Loggable<Logge

next_query = std::move(pending_queries_.front());
pending_queries_.pop_front();
if (reresolve && next_query->cancelled_) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it's probably not important, but do we need the reresolve condition here? In other words, shouldn't any next_query that is in the cancelled state be skipped? I realize the only way this can happen right now is if reresolve is true below and we get EAI_AGAIN so we add it back to pending_queries_.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's currently possible to start a resolve and cancel before it gets popped from the queue at which point we'll do the resolve anyway. doubt it matters but wanted it guarded just in case.

Copy link
Contributor Author

@alyssawilk alyssawilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also tsan caught the issue I was hoping to fix in a follow-up which is that cancel was always non-thread-safe.
/wait

@@ -157,6 +159,9 @@ class GetAddrInfoDnsResolver : public DnsResolver, public Logger::Loggable<Logge

next_query = std::move(pending_queries_.front());
pending_queries_.pop_front();
if (reresolve && next_query->cancelled_) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's currently possible to start a resolve and cancel before it gets popped from the queue at which point we'll do the resolve anyway. doubt it matters but wanted it guarded just in case.

Signed-off-by: Alyssa Wilk <[email protected]>
@alyssawilk alyssawilk merged commit 7f6df24 into envoyproxy:main Mar 27, 2024
53 checks passed
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Mar 27, 2024
alyssawilk added a commit that referenced this pull request Mar 27, 2024
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Apr 3, 2024
alyssawilk added a commit that referenced this pull request Apr 4, 2024
* Reapply "getaddrinfo: retrying on eai_again (#33130)" (#33159)

Risk Level: low
Testing: new tests
Docs Changes: n/a
Release Notes: inline
[Optional Runtime guard:] yes

Signed-off-by: Alyssa Wilk <[email protected]>
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
Risk Level: low
Testing: new tests
Docs Changes: n/a
Release Notes: inline
[Optional Runtime guard:] yes

Signed-off-by: Alyssa Wilk <[email protected]>
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
alyssawilk added a commit to alyssawilk/envoy that referenced this pull request Apr 29, 2024
* Reapply "getaddrinfo: retrying on eai_again (envoyproxy#33130)" (envoyproxy#33159)

Risk Level: low
Testing: new tests
Docs Changes: n/a
Release Notes: inline
[Optional Runtime guard:] yes

Signed-off-by: Alyssa Wilk <[email protected]>
@alyssawilk alyssawilk deleted the addr branch June 25, 2024 14:50
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.

3 participants