-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
release-v1.12: back port #9509 http: Fix ASSERT failure and infinite loop when attempting to unset readDisable state on a closed connection #10802
Conversation
/assign @PiotrSikora |
backport #9509 |
…eadDisable state on a closed connection. (envoyproxy#9509) Description: Handle calls to ConnectionImpl::readDisable on Closed connections more gracefully. There are several places under source/common, including ClientConnectionImpl::onMessageComplete, where Connection::readDisable(false) is called on a loop to clear the readDisable state as part of the process of preparing upstream connections for reuse. It is possible to end up in an infinite loop if proxying an HTTP/1 response is framed by connection close, the call to onData triggers readDisable(true), and there is a pending PostIoAction::Close action. The closeSocket call on the upstreamConnection triggers the call to ClientConnectionImpl::onMessageComplete Risk Level: medium Testing: unit and integration tests Docs Changes: n/a Release Notes: n/a Fixes envoyproxy#9508 Signed-off-by: Antonio Vicente <avd@google.com> Signed-off-by: Yuchen Dai <silentdai@gmail.com>
/azp run envoy-presubmit |
Commenter does not have sufficient privileges for PR 10802 in repo envoyproxy/envoy |
/retest ci/circleci: coverage |
🔨 rebuilding |
The failing test is a KP: #10287 |
Not sure what is missing. The request is not complete because of "[2020-04-20 19:26:30.184][14][debug][client] [source/common/http/codec_client.cc:124] [C0] protocol error: http/1.1 protocol error: HPE_INVALID_EOF_STATE" Will investigate.
|
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
Not, stale. @lambdai any luck with the failing test? |
@PiotrSikora Sorry I have been working on 1.6. I didn't find an obvious error when I looked at this with my fragment time. |
@antoniovicente I need your help. Can you share any light why the test is failing? Any suspicious PR should go with this PR? |
/assign @antoniovicente |
HPE_INVALID_EOF_STATE is set by the http_parser library. I'm going to guess that the issue may be related to the version of http_parser used by 1.12 or envoy changes to correctly handle HTTP/1.0 responses without content-length. |
Thanks! Since you mention http1.0 while the protocol in log is http1.1, maybe envoy 1.12 need extra steps to set up http1.0. I will run more experiment |
The issue is with backend responses without content-length or transfer-encoding:chunked. HTTP/1.1 prefers having transfer-encoding:chunked on responses like this one, but should accept ones without it. In HTTP/1.0 transfer-encoding:chunked is not supported so framing by connection close is the only option if content-length is not available. My guess is about http_parser version, but there may be some envoy specific changes also. Have you tried updating the version of http_parser dependency? You may need help from people that have been involved with Envoy longer than I have. |
Did you try this? Just making sure you're not blocked on me. |
This pull request has been automatically marked as stale because it has not had activity in the last 7 days. It will be closed in 7 days if no further activity occurs. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
This pull request has been automatically closed because it has not had activity in the last 14 days. Please feel free to give a status update now, ping for review, or re-open when it's ready. Thank you for your contributions! |
@lambdai any update? |
…eadDisable state on a closed connection. (#9509)
Description: Handle calls to ConnectionImpl::readDisable on Closed connections more gracefully. There are several places under source/common, including ClientConnectionImpl::onMessageComplete, where Connection::readDisable(false) is called on a loop to clear the readDisable state as part of the process of preparing upstream connections for reuse. It is possible to end up in an infinite loop if proxying an HTTP/1 response is framed by connection close, the call to onData triggers readDisable(true), and there is a pending PostIoAction::Close action. The closeSocket call on the upstreamConnection triggers the call to ClientConnectionImpl::onMessageComplete
Risk Level: medium
Testing: unit and integration tests
Docs Changes: n/a
Release Notes: n/a
Fixes #9508
Signed-off-by: Antonio Vicente avd@google.com
For an explanation of how to fill out the fields, please see the relevant section
in PULL_REQUESTS.md
Description:
Risk Level:
Testing:
Docs Changes:
Release Notes:
[Optional Fixes #Issue]
[Optional Deprecated:]