General

Profile

mohamedhafez (Mohamed Hafez)

  • Login: mohamedhafez
  • Registered on: 05/27/2016
  • Last sign in: 09/21/2025

Issues

open closed Total
Assigned issues 0 0 0
Reported issues 3 0 3

Activity

03/23/2025

10:45 AM Ruby Revision 7e0dac4c (git): Add test for Ractor safety (#11762)
mohamedhafez (Mohamed Hafez)

04/28/2021

01:58 AM Ruby Revision 8a2b7b79 (git): [ruby/net-http] Replace Timeout.timeout in Net:HTTP#connect
Use Socket.tcp's connect_timeout option instead
https://github.com/ruby/net-http/commit/753cae3bbc
mohamedhafez (Mohamed Hafez)
01:47 AM Ruby Revision ff931d03 (git): [ruby/net-smtp] Replace Timeout.timeout with socket timeout
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/6ae4a59f05
mohamedhafez (Mohamed Hafez)

04/27/2021

12:20 PM Ruby Revision a86c6cb3 (git): [ruby/net-ftp] Replace Timeout.timeout with socket timeout
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)

01/13/2021

08:50 PM Ruby Feature #17528: Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout
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)
04:05 PM Ruby Feature #17528: Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout
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)

01/11/2021

08:53 PM Ruby Feature #17528 (Open): Make Addrinfo.getaddrinfo fall back to Timeout.timeout for :resolv_timeout
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)

03/05/2020

12:16 AM Ruby Feature #16673 (Open): total_timeout for Net::HTTP
`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)

05/28/2016

07:57 PM Ruby Feature #12435 (Open): Using connect_nonblock to open TCP connections in Net::HTTP#connect
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)

Also available in: Atom