Repository navigation
fix: keep a new pooled connection until its first request - #1045
Merged
Merged
Conversation
A fresh pooled HTTP/1.1 conn taken with hackney:connect was closed by the keepalive timer if unused for keepalive_timeout, while a reused one was not. The timer now starts when the pool takes a conn back, so a fresh conn waits for its request and one given back unused still ages out. Fixes #938.
Merged
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.
A new pooled HTTP/1.1 connection taken with
hackney:connectwas closed by the pool's keepalive timer if no request was sent on it withinkeepalive_timeout(2 s by default), and the nextsend_requestgot{error, closed}. A reused connection held the same way stayed open, because checkout cancels that timer (#934). #1042 fixed the same thing during a slow TLS upgrade; this covers plain HTTP, the rest of #938.The keepalive timer now starts when the pool takes a connection back instead of on the first entry of a connection its caller just dialed. A connection given back without carrying a request used to sit in the pool with no timer at all; it now ages out like any idle pooled connection. A held connection still closes after the keepalive timeout when idle between two requests, as before.
No breaking change.
Fixes #938