Timeout.timeout is inefficient since it spins up a new thread for each invocation, use Socket.tcp's connect_timeout option instead https://github.com/ruby/net-smtp/commit/6ae4a59f05mohamedhafez (Mohamed Hafez)
Timeout.timeout is inefficient since it spins up a new thread for each invocation, use Socket.tcp's connect_timeout option instead when we aren't using SOCKS (we can't replace Timeout.timeout for SOCKS yet since SOCKSSocket doesn't have ...mohamedhafez (Mohamed Hafez)
I was just doing a similar test actually, I think you're correct! I'll close this issue and re-submit a patch to Net::HTTP to replace `Timeout::timeout` there, since it's not doing anything for DNS lookups anyway. Thank you!mohamedhafez (Mohamed Hafez)
According to https://bugs.ruby-lang.org/issues/12435, the only reason we are using `Timeout.timeout` in `Net::HTTP#connect` instead of using nonblocking io and `IO.select` is so that we can place a timeout on the getaddrinfo function, @n...mohamedhafez (Mohamed Hafez)
Currently, `Addrinfo.getaddrinfo` ignores the `:resolv_timeout` option if we are on a system without `getaddrinfo_a`. It would be great if instead it would fall back to using `Timeout.timeout`. That way, we could get rid of a lot of t...mohamedhafez (Mohamed Hafez)
`Net::HTTP` allows setting `open_timeout` and `read_timeout`, but sometimes I just want to make sure an API call will finish within a set amount of time, and am not concerned with how long opening the connection takes and reading the con...mohamedhafez (Mohamed Hafez)
Hey all, I've got a pull request at https://github.com/ruby/ruby/pull/1370 to start using connect_nonblock to open the TCP socket in Net::HTTP#connect, instead of doing a blocking connect that uses Timeout.timeout to look for timeouts. U...mohamedhafez (Mohamed Hafez)