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

health check: close conn after timeout/stream rst when grpc hc has conn reuse disabled #11325

Merged

Conversation

jmuia
Copy link
Contributor

@jmuia jmuia commented May 26, 2020

Commit Message:
Close connection after timeout/stream reset when grpc health checker has connection reuse disabled.

Additional Description:
While investigating, #11324, I noticed that it seems connections aren't closed when there is a timeout or stream reset and connection reuse is disabled.

Risk Level: low/medium
Testing: added unit tests
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Joey Muia joseph.b.muia@gmail.com

@murray-stripe
Copy link
Contributor

@lizan Similar to #11324 - I could not reproduce the test-failures using the following commands:

./ci/do_ci.sh 'bazel.release' //test/common/config:subscription_factory_impl_test
# or
bazel test //test/common/config:subscription_factory_impl_test

The test-failure is the same as #11324 and doesn't seem related to the change. I'm not sure if this is a common flake or if I am missing something with my test commands. If it's likely flakey, could you kick off the azure pipeline run again?

jmuia added 2 commits May 29, 2020 09:36
…nn reuse disabled

Signed-off-by: Joey Muia <joseph.b.muia@gmail.com>
Signed-off-by: Joey Muia <joseph.b.muia@gmail.com>
@jmuia jmuia force-pushed the jmuia.grpc-hc-reuse-conn-timeout branch from bc253f9 to a81e1b9 Compare May 29, 2020 16:43
Signed-off-by: Joey Muia <joseph.b.muia@gmail.com>
Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

Thanks this seems reasonable to me, just a few notes on the tests.

In the future it would great if you could refrain from rebasing the PR, as per https://github.com/envoyproxy/envoy/blob/master/CONTRIBUTING.md#submitting-a-pr.

@@ -4487,6 +4487,60 @@ TEST_F(GrpcHealthCheckerImplTest, DontReuseConnectionBetweenChecks) {
expectHostHealthy(true);
}

TEST_F(GrpcHealthCheckerImplTest, DontReuseConnectionTimeout) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment to this test case to make it easier to understand which assertion is verifying that we're not reusing the connection? I think its expectClientCreate but it would be nice with a comment alongside it

test_sessions_[0]->request_encoder_.stream_.resetStream(Http::StreamResetReason::RemoteReset);
expectHostHealthy(true);

expectClientCreate(0);
Copy link
Contributor

Choose a reason for hiding this comment

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

same comment here

Signed-off-by: Joey Muia <joseph.b.muia@gmail.com>
@jmuia jmuia requested a review from snowp June 1, 2020 16:16
Copy link
Contributor

@snowp snowp left a comment

Choose a reason for hiding this comment

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

LGTM.

@mattklein123 mind sanity checking that this is the right thing to do?

@mattklein123 mattklein123 self-assigned this Jun 2, 2020
@mattklein123 mattklein123 merged commit f3b9575 into envoyproxy:master Jun 3, 2020
auni53 pushed a commit to auni53/envoy that referenced this pull request Jun 4, 2020
…nn reuse disabled (envoyproxy#11325)

Close connection after timeout/stream reset when grpc health checker has connection reuse disabled.

Signed-off-by: Joey Muia <joseph.b.muia@gmail.com>
Signed-off-by: Auni Ahsan <auni@google.com>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
…nn reuse disabled (envoyproxy#11325)

Close connection after timeout/stream reset when grpc health checker has connection reuse disabled.

Signed-off-by: Joey Muia <joseph.b.muia@gmail.com>
Signed-off-by: yashwant121 <yadavyashwant36@gmail.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.

4 participants