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

dns cache: do not runRemoveCallbacks if runAddUpdateCallbacks has not fired #10003

Merged
merged 3 commits into from
Feb 11, 2020
Merged

Conversation

junr03
Copy link
Member

@junr03 junr03 commented Feb 11, 2020

Description: previously the DnsCacheImpl would fire runRemoveCallbacks for a host when TTL expired even if it had potentially never fired runAddUpdateCallbacks. Therefore, the callback's target (the Dynamic Forward Proxy Cluster) reaches bad state. The Cluster tries to remove a host that doesn't exist from its point of view and trips this assertion. This PR ensures that the DnsCacheImpl only fires runRemoveCallbacks if it has previously fired runAddUpdateCallbacks for a host.
Risk Level: low, fixes erroneous behavior.
Testing: added repro in existing unit tests, and verified that updated code fixed the test.

Signed-off-by: Jose Nino jnino@lyft.com

Jose Nino added 3 commits February 10, 2020 22:26
… fired

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: Jose Nino <jnino@lyft.com>
@junr03
Copy link
Member Author

junr03 commented Feb 11, 2020

This was originally reproduced in Envoy Mobile envoyproxy/envoy-mobile#671

Copy link
Member

@mattklein123 mattklein123 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks for fixing my bug!

@mattklein123 mattklein123 merged commit c472e94 into envoyproxy:master Feb 11, 2020
junr03 added a commit to envoyproxy/envoy-mobile that referenced this pull request Feb 11, 2020
This bump brings in two relevant fixes

    envoyproxy/envoy#10002 fixes #677
    envoyproxy/envoy#10003 fixes #671

Signed-off-by: Jose Nino <jnino@lyft.com>
jpsim pushed a commit that referenced this pull request Nov 28, 2022
This bump brings in two relevant fixes

    #10002 fixes #677
    #10003 fixes #671

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
jpsim pushed a commit that referenced this pull request Nov 29, 2022
This bump brings in two relevant fixes

    #10002 fixes #677
    #10003 fixes #671

Signed-off-by: Jose Nino <jnino@lyft.com>
Signed-off-by: JP Simard <jp@jpsim.com>
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.

2 participants