TCP keepalive is not respected when re-using connections
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 , 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.