Skip to content

Remove Timeout.timeout #542

Description

@Gargron

Timeout.timeout is not thread-safe and can interrupt any line, anywhere. Using native timeouts on the system level, or using IO.select is recommended for sockets. HTTP.rb already uses the right thing for read/write timeouts, but not connect.

I was able to use a better timeout for DNS resolving by overriding the socket class and using Resolv, however, that still leaves the opening of the actual socket, and the SSL handshake.

What can I do to avoid Timeout.timeout while not exposing myself to unreachable hosts taking infinitely long during the connect phase? I need to use HTTP.rb in a connection pool.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions