HTTP.jl icon indicating copy to clipboard operation
HTTP.jl copied to clipboard

TCP keepalive is not respected when re-using connections

Open geokollias opened this issue 5 years ago • 1 comments

Julia 1.5.2 HTTP.jl 0.8.19

Problem: HTTP.request(..., keepalive=true, ...) might re-use a connection whose keep-alive is disabled.

After some investigation, it seems the culprit is in ConnectionPool.jl. When it decides about re-using a connection, it doesn't check if that connection has (TCP) keep-alive enabled or not. IIUC, the decision for re-usability relies on hashconn which involves the checking of: socket type, host, port, pipeline limit & ssl verification. I'm thinking that hashconn should include keep-alive as well.

What do you think?

I'm happy to open a PR with a fix.

geokollias avatar Oct 30 '20 15:10 geokollias

@geokollias , sorry for the very slow response here. Yes, I agree we should probably include keep-alive in the hashconn consideration. If you'd still be up for doing a PR, it would be welcome.

quinnj avatar Mar 16 '22 18:03 quinnj