-
Notifications
You must be signed in to change notification settings - Fork 177
Expose IO#timeout
and IO#timeout=
if available
#693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Actually, might not be that simple, as the buffering layer breaks on a timeout:
I'll have to dig deeper. |
Yeah, definitely doesn't work, |
openssl/ext/openssl/ossl_ssl.c Line 1744 in fac5cac
Maybe we need to set it to nonblock mode? In theory, it should use the default timeout. |
Perhaps? I'm not quite familiar enough with that code. |
@rhenium is there a chance you can help look into this? I'm happy to help. |
There seem to be two issues before the buffering layer. IO::Timeout isn't raised by OpenSSL::SSL at all. Also, a single blocking operation on TLS, such as |
The underlying socket is set to non-blocking mode by SSLSocket#initialize. We needed this for implementing SSLSocket#read_nonblock and also because we didn't want blocking IO within libssl while holding the GVL. |
@io.timeout = timeout | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SocketForwarder (in this file, above) is the right place for this definition.
Thanks for this clarification. If users desire application level timeouts, e.g. "This group of operations should take at most X seconds", they should use |
This is superseded by #714 which fixes SSLSocket to correctly raise |
Ref: https://bugs.ruby-lang.org/issues/18630
FYI: @ioquatix