Closed
Description
In d25dae5, the implementation of TcpStream::connect
was switched from using mio's non-blocking connect to the blocking std::net::TcpStream::connect
which is performed in a background thread created by spawn_blocking
. May I ask why you decided to no longer use mio's non-blocking connect? It seems the background thread spawned is unaware of any future cancellation, e.g. due to timeouts, but continues to run until all SYN retries have been exhausted which may easily last a couple of minutes. This in turn can cause a high number of threads to be created in the background.
Activity
ghost commentedon Jan 21, 2020
Hmmm, that definitely looks like an oversight during the refactor. I agree with you - we should use mio's non-blocking connect. Happy to review a PR for it!