-
Notifications
You must be signed in to change notification settings - Fork 847
Fix PROXY protocol out with tls #9698
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
Conversation
| > POST / HTTP/1.1 | ||
| `` | ||
| < HTTP/1.1 502 Connection refused | ||
| < HTTP/1.1 502 Broken pipe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers:
The post_slow_server_max_requests_in was failing with my changes, as it expects a 502 Connection refused, but gets a 502 Broken pipe.
The expectation changed from 502 Broken pipe->502 Connection refused as part of the #9366. Discussed with @bneradt and we believe we should update/revert the expectation to the original. After this PR, certain things seem to be more aligned to how they worked pre H2ToOrigin.
bneradt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks for fixing and updating the tests.
|
[approve ci centos] |
* asf/master: Fix PROXY protocol out with tls (apache#9698) Add automatic detection of ccache for cmake (apache#9720) Fix cqpv log field value on H3 connections (apache#9719) system_stats: fix buffer overflow caught by asan (apache#9723)
While updating the PROXY protocol tests, I observe the https connections to the origin would hang when PROXY protocol out is enabled in ATS. This PR addresses this.
root cause
After the #9366 changes, the logic of kicking off state machine is in
ConnectingEntryand is triggered by callbacks upon one ofVC_EVENT_READ_COMPLETE,VC_EVENT_WRITE_READYorVC_EVENT_WRITE_COMPLETEevents. The root cause of the hang has to do with none of these events is triggered:VC_EVENT_WRITE_READYis triggered and the connection flows. However when PROXY protocol out is enabled, as PROXY protocol data is sent before ssl handshake, the accounting ofvio.nbytesandvio.donechanged , leading toVC_EVENT_WRITE_READYnot being triggered.VC_EVENT_READ_COMPLETEis not triggered becausevioread is not enabled. Prior to Http2 to origin #9366,attach_server_session()enables vio read and is called prior to the handshake. After Http2 to origin #9366, this is called after the handshake so thevioread is disabled during the handshake. As read is disabled, theVC_EVENT_READ_COMPLETEcan't be signaled to the handler.This PR adds a 0-byte read so the
vioread is enabled andConnectingEntry::state_http_server_open()handler can be signaled and called back with theVC_EVENT_READ_COMPLETEevent.