lib: set an aggressive draining timeout when closed before established #1754
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.
It is possible that a server could close a connection without ever sending
an ACK frame. For example, when immeditaly closing a connection due to a
TLS-level reason.
Previously, we always would set the draining timer the same way when processing
CONNECTION_CLOSE frames, basing it on 3*PTO. In the situation where there
is no accurate RTT estimate, the PTO is based on the default initial RTT,
which comes out at 999ms. This leads to clients that honor the draining
period to have to wait 3 seconds for no real reason.
With this change, in the situation where a CONNECTION_CLOSE is received
before the connection is established, we'll just immediately timeout.