Skip to content
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

Timeout during SSL connection should be treated as timeout in JRuby #381

Closed
dgolombek opened this issue Oct 23, 2017 · 0 comments · Fixed by #382
Closed

Timeout during SSL connection should be treated as timeout in JRuby #381

dgolombek opened this issue Oct 23, 2017 · 0 comments · Fixed by #382

Comments

@dgolombek
Copy link

If a Java::JavaNet::SocketTimeoutException is thrown while connecting in JRuby it's currently re-raised as a generic OpenSSL::SSL::SSLError, instead of as a HTTPClient::TimeoutError. This is because SocketTimeoutException is a subclass of IOException, and thus this gets covered by the generic IOException handling (/~https://github.com/nahi/httpclient/blob/master/lib/httpclient/jruby_ssl_socket.rb#L495). It's useful to handle TimeoutExceptions differently (CircuitBreaker pattern, in my case), so I'd like to break this handling out. This will ALSO help avoid a JRuby bug that this triggers (jruby/jruby#3834) where this wrapped exception is then turned into an anonymous exception.

dgolombek pushed a commit to dgolombek/httpclient that referenced this issue Oct 23, 2017
This fixes nahi#381 by adding explicit handling for
Java::JavaNet::SocketTimeoutException when establishing a JRuby SSL
connection.
@nahi nahi closed this as completed in #382 Feb 3, 2019
mumumu pushed a commit to mumumu/httpclient that referenced this issue Feb 4, 2019
This fixes nahi#381 by adding explicit handling for
Java::JavaNet::SocketTimeoutException when establishing a JRuby SSL
connection.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant