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

test: fixing flake. #11507

Merged
merged 3 commits into from
Jun 9, 2020
Merged

test: fixing flake. #11507

merged 3 commits into from
Jun 9, 2020

Conversation

alyssawilk
Copy link
Contributor

This is one of those cases where we actually want delay-close: we are doing a large upload, Enovy sends a response, and we want to make sure the socket stays open long enough the response is received rather than short delay-close causing a connection reset during upload

Risk Level: n/a (test only)
Testing: indeed
Docs Changes: n/a
Release Notes: n/a

Signed-off-by: Alyssa Wilk <[email protected]>
// Make sure the connection isn't closed during request upload.
config_helper_.addConfigModifier(
[](envoy::extensions::filters::network::http_connection_manager::v3::HttpConnectionManager&
hcm) { hcm.mutable_delayed_close_timeout()->set_seconds(1000 * 1000); });
Copy link
Member

Choose a reason for hiding this comment

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

Sorry how does configuring the delayed close timeout to a large value deflake this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The client sends a large request.
Some time during request upload, Envoy gives up buffering, and sends a local error response.

The test waits for the response to be complete. If Envoy has a short delay close, it is possible that the local response is sent (but not read) while the request is uploading, then the connection is closed, and continued upload produces a reset before the request is complete.

Ideally the test client would be reading as it's writing and get the complete request, but that's not guaranteed today.

Copy link
Member

Choose a reason for hiding this comment

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

Ah OK I see. Do you mind expanding the comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

IMO the real solution to this both for Envoy upstream and Envoy mobile is to drain the connection on error in case of connection:close etc. Long ago when Andres tackled drain close we agreed we should fix on both ends but I don't think we ever got around to the other side of it.

Signed-off-by: Alyssa Wilk <[email protected]>
mattklein123
mattklein123 previously approved these changes Jun 9, 2020
@alyssawilk alyssawilk merged commit 2b83bc9 into envoyproxy:master Jun 9, 2020
songhu pushed a commit to songhu/envoy that referenced this pull request Jun 25, 2020
This is one of those cases where we actually want delay-close: we are doing a large upload, Enovy sends a response, and we want to make sure the socket stays open long enough the response is received rather than short delay-close causing a connection reset during upload

Risk Level: n/a (test only)
Testing: indeed
Docs Changes: n/a
Release Notes: n/a
Signed-off-by: Alyssa Wilk <[email protected]>
yashwant121 pushed a commit to yashwant121/envoy that referenced this pull request Jul 24, 2020
This is one of those cases where we actually want delay-close: we are doing a large upload, Enovy sends a response, and we want to make sure the socket stays open long enough the response is received rather than short delay-close causing a connection reset during upload

Risk Level: n/a (test only)
Testing: indeed
Docs Changes: n/a
Release Notes: n/a
Signed-off-by: Alyssa Wilk <[email protected]>
Signed-off-by: yashwant121 <[email protected]>
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