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

add http1-safe max_connection_duration for http connection manager #35209

Merged
merged 27 commits into from
Aug 8, 2024

Conversation

antoniovleonti
Copy link
Contributor

@antoniovleonti antoniovleonti commented Jul 16, 2024

Commit Message: add http1-safe max_connection_duration for http connection manager

This PR adds an option to change the http connection manager's draining behavior for max_connection_duration for http1. The new behavior is that envoy will wait indefinitely for one more request, add connection:close to the response headers, then close the connection once the stream ends.

This is to avoid a networking race condition which results in the client not receiving a response to their last request if they send it right when envoy is closing the connection.

Fixes #34356 (check for context)

Copy link

CC @envoyproxy/api-shepherds: Your approval is needed for changes made to (api/envoy/|docs/root/api-docs/).
envoyproxy/api-shepherds assignee is @abeyad
CC @envoyproxy/api-watchers: FYI only for changes made to (api/envoy/|docs/root/api-docs/).

🐱

Caused by: #35209 was opened by antoniovleonti.

see: more, trace.

@antoniovleonti
Copy link
Contributor Author

/assign @KBaichoo

Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: antoniovleonti <[email protected]>
@antoniovleonti
Copy link
Contributor Author

/retest

Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: antoniovleonti <[email protected]>
@antoniovleonti
Copy link
Contributor Author

/retest

@antoniovleonti
Copy link
Contributor Author

@KBaichoo CI errors fixed, PTAL

@KBaichoo
Copy link
Contributor

Thanks @antoniovleonti , will give a pass later today!

Copy link
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

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

/wait

Thank you for working on this

Copy link
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

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

Otherwise lgtm. Can you also update the description (or the issue) to better capture the end behavior since we iterated on it? Thank you

Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: antoniovleonti <[email protected]>
@antoniovleonti
Copy link
Contributor Author

Otherwise lgtm. Can you also update the description (or the issue) to better capture the end behavior since we iterated on it? Thank you

The description has been updated. Thanks!

KBaichoo
KBaichoo previously approved these changes Aug 6, 2024
Copy link
Contributor

@KBaichoo KBaichoo left a comment

Choose a reason for hiding this comment

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

Thank you

@KBaichoo
Copy link
Contributor

KBaichoo commented Aug 6, 2024

/assign @yanavlasov

@yanavlasov
Copy link
Contributor

Needs main merge to fix coverage build error.

Copy link
Contributor

@yanavlasov yanavlasov left a comment

Choose a reason for hiding this comment

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

LGTM,. See if you can replace the check for log message with the check for stat value.

/wait-any

changelogs/current.yaml Show resolved Hide resolved
test/common/http/conn_manager_impl_test_2.cc Outdated Show resolved Hide resolved
Signed-off-by: antoniovleonti <[email protected]>
@yanavlasov yanavlasov enabled auto-merge (squash) August 8, 2024 15:10
@yanavlasov yanavlasov merged commit 5b22dce into envoyproxy:main Aug 8, 2024
50 of 52 checks passed
martinduke pushed a commit to martinduke/envoy that referenced this pull request Aug 8, 2024
…nvoyproxy#35209)

This PR adds an option to change the http connection manager's draining
behavior for max_connection_duration for http1. The new behavior is that
envoy will wait indefinitely for one more request, add connection:close
to the response headers, then close the connection once the stream ends.

This is to avoid a networking race condition which results in the client
not receiving a response to their last request if they send it right
when envoy is closing the connection.

Fixes envoyproxy#34356 (check for context)

---------

Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: Martin Duke <[email protected]>
@antoniovleonti antoniovleonti deleted the soft-mcd branch August 12, 2024 17:06
RyanTheOptimist pushed a commit that referenced this pull request Aug 12, 2024
Commit Message: test: update a broken test due to PRs race
Additional Description:
PR #35568 used an old `setup()` method call which was modified by PR
#35209 that was merged just before it, causing a build failure.
This PR update the test and fixes the build failure.

Risk Level: low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Adi Suissa-Peleg <[email protected]>
asingh-g pushed a commit to asingh-g/envoy that referenced this pull request Aug 20, 2024
…nvoyproxy#35209)

This PR adds an option to change the http connection manager's draining
behavior for max_connection_duration for http1. The new behavior is that
envoy will wait indefinitely for one more request, add connection:close
to the response headers, then close the connection once the stream ends.

This is to avoid a networking race condition which results in the client
not receiving a response to their last request if they send it right
when envoy is closing the connection.

Fixes envoyproxy#34356 (check for context)

---------

Signed-off-by: antoniovleonti <[email protected]>
Signed-off-by: asingh-g <[email protected]>
asingh-g pushed a commit to asingh-g/envoy that referenced this pull request Aug 20, 2024
Commit Message: test: update a broken test due to PRs race
Additional Description:
PR envoyproxy#35568 used an old `setup()` method call which was modified by PR
envoyproxy#35209 that was merged just before it, causing a build failure.
This PR update the test and fixes the build failure.

Risk Level: low
Testing: N/A
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A

Signed-off-by: Adi Suissa-Peleg <[email protected]>
Signed-off-by: asingh-g <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants