Adjust connection timeout for TLS#4903
Merged
shinrich merged 1 commit intoapache:masterfrom Feb 4, 2019
Merged
Conversation
SolidWallOfCode
approved these changes
Feb 1, 2019
Contributor
|
@shinrich So with this fix, we don't need to backout the TTFB PR from 8.0.x? If so, we should put that back in for 8.1.x as well IMO. |
Contributor
|
This is a fix for #4028 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found the following crash.
Line numbers on our branch are off from open source master, but top of stack from write_to_net_io is in code below
Specifically the crash is at the "ret = vc->sslStartHandShake(SSL_EVENT_CLIENT, err);" and looking in the core shows that "vc" has been freed (vtable pointer is bogus).
I think the issue is how we are handling notifying the state machine that the socket is in a write-ready state (SYN exchange has completed) with the call to write_signal_and_update. We assume that the vc is in a good state after this call, but it is quite possible that the HttpSM has determined it is in an error state and closed the vc.
I think we should reconsider how the connect timeout should apply to the TLS connection. Rather than just covering the SYN exchange, I would argue that it should cover the entire TLS handshake. If the TLS handshake stalls out, that should be covered by the connection timeout not the data no-activity timeout. Making that change would remove the write_signal_and_update here. Instead we don't notify the state machine until the read_complete signal sent at the end of the TLS handshake.
This PR makes that change.
We haven't see this crash very often, but the original TTFB timeout fix was backed out of the 8.0.x branch I assume due to instability issues.