Skip to content

hds: reset specifier_hash on remoteClose - #17378

Merged
snowp merged 4 commits into
envoyproxy:mainfrom
lobkovilya:fix/hds-reset-hash
Jul 22, 2021
Merged

snowp merged 4 commits into
envoyproxy:mainfrom
lobkovilya:fix/hds-reset-hash

Conversation

@lobkovilya

@lobkovilya lobkovilya commented Jul 16, 2021 •

Copy link
Copy Markdown
Contributor

Signed-off-by: Ilya Lobkov [email protected]

Commit Message: when Envoy is reconnected to the management server it may receive the same HealthCheckSpecifier. Since specifier_hash_ is equal to the new hash Envoy won't call enableTimer and thus EndpointHealthResponse won't be sent after reconnect at all. That's why in the onRemoteClose this specifier_hash_ has to be reset.
Additional Description: N/A
Risk Level: low
Testing: manual
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

@repokitteh-read-only

Copy link
Copy Markdown

Hi @lobkovilya, welcome and thank you for your contribution.

We will try to review your Pull Request as quickly as possible.

In the meantime, please take a look at the contribution guidelines if you have not done so already.

🐱

Caused by: #17378 was opened by lobkovilya.

see: more, trace.

@lobkovilya

Copy link
Copy Markdown
Contributor Author

Hello from Kuma community 👋

We've run into this issue while testing various resilient scenarios, playing around with network delays and reconnections. The problem could be reproduced using toxiproxy between Envoy and Kuma Control Plane: after reconnecting Kuma Control Plane doesn't receive health information from Envoy.

cc: @bchatelard

@snowp

snowp commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

Thanks for the fix! Do you think you could add a regression test to make sure this won't break in the future?

@snowp snowp self-assigned this Jul 16, 2021
@lobkovilya

Copy link
Copy Markdown
Contributor Author

That's would be interesting to try to reproduce the problem using a test, let's see if I can do so in a reasonable amount of time. I have a couple of questions:

  1. test/integration/health_check_integration_test.cc is it the right place to put a new regression test into?
  2. I see envoy-presubmit failed, am I doing something wrong?

@snowp

snowp commented Jul 16, 2021

Copy link
Copy Markdown
Contributor

Yeah I think that's the right test file.

The failure seems to be coverage flakes, I wouldn't worry about it at this point

Signed-off-by: Ilya Lobkov <[email protected]>
@lobkovilya

Copy link
Copy Markdown
Contributor Author

@snowp I was able to reproduce the problem using the test, please take a look

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, just a few comments. Seems like CI is failing, can you take a look?


// Tests Envoy keeps sending EndpointHealthResponses after the HDS server reconnection
TEST_P(HdsIntegrationTest, SingleEndpointHealthyHttpHdsReconnect) {
XDS_DEPRECATED_FEATURE_TEST_SKIP;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why do we need this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure, every test in the hds_integration_test has this macro. Probably HDS doesn't work with V2?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Seems like it uses some deprecated fields in the setup, so it would need some small refactor to fix. No need to do in this PR

checkCounters(1, 2, 1, 0);

// Simulate disconnection of HDS server
hds_fake_connection_->encodeProtocolError();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

maybe just close the stream here?

@snowp snowp added the waiting label Jul 21, 2021
Signed-off-by: Ilya Lobkov <[email protected]>
Signed-off-by: Ilya Lobkov <[email protected]>

@snowp snowp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks!

@snowp
snowp merged commit 2cc9b69 into envoyproxy:main Jul 22, 2021
leyao-daily pushed a commit to leyao-daily/envoy that referenced this pull request Sep 30, 2021
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