You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're connection to Elasticsearch from Go, and notice some Connection reset at the Elasticsearch side. After some investigations, it seems that http.Transport.getConn will try to get an idle connection from the pool (queueForIdleConn) and dial the remote host (queueForDial) at the same time. So if the request finished and req.Context cancelled before dial complete, the addTLS step will fail due to context cancelled. Is it possible to continue the dialing and TLS handshake so we can get an usable connection instead of aborting it?
What did you expect to see?
If the req.Context finished before TLS handshake finish, the dialing connection will get closed.
What did you see instead?
The dialing step can finish and the connection can be put into the idle pool.
The text was updated successfully, but these errors were encountered:
seankhliao
changed the title
[net/http]: Transport.getConn is wasting one connection sometimes.
net/http: Transport.getConn is wasting one connection sometimes.
May 10, 2023
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We're connection to Elasticsearch from Go, and notice some
Connection reset
at the Elasticsearch side. After some investigations, it seems thathttp.Transport.getConn
will try to get an idle connection from the pool (queueForIdleConn
) and dial the remote host (queueForDial
) at the same time. So if the request finished andreq.Context
cancelled before dial complete, theaddTLS
step will fail due to context cancelled. Is it possible to continue the dialing and TLS handshake so we can get an usable connection instead of aborting it?What did you expect to see?
If the
req.Context
finished before TLS handshake finish, the dialing connection will get closed.What did you see instead?
The dialing step can finish and the connection can be put into the idle pool.
The text was updated successfully, but these errors were encountered: