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

undefined method `write_nonblock' for OpenSSL::SSL::SSLSocket #19

Open
atambo opened this issue Feb 24, 2012 · 7 comments
Open

undefined method `write_nonblock' for OpenSSL::SSL::SSLSocket #19

atambo opened this issue Feb 24, 2012 · 7 comments

Comments

@atambo
Copy link
Member

atambo commented Feb 24, 2012

When I upgraded from jruby-openssl 0.7.4 to 0.7.6.1 I started getting this error when trying to do file uploads to amazon s3 using the fog gem:

https://gist.github.com/1694196

@nahi
Copy link
Member

nahi commented Feb 24, 2012

Sorry for lazy question, but is it really worked with jruby-openssl 0.7.4? It could be from excon's update I think. Can you try this with jruby-openssl 0.7.4 again?

That said, jruby-openssl + 1.9 does not support *_nonblock properly yet...

@atambo
Copy link
Member Author

atambo commented Feb 24, 2012

The excon gem version did not change. I am using the newest version of excon and I can reproduce this problem by only swapping the jruby-openssl version.

@pehrlich
Copy link

Just a little bump here-- I can confirm that downgrading from 0.7.6.1 to 0.7.4 fixes issues from this thread: excon/excon#106

@rahul
Copy link

rahul commented Mar 27, 2012

@pehrlich +1

@nextmat
Copy link

nextmat commented Mar 27, 2012

+1

@azolotko
Copy link

Tested on version 0.7.7. The problem is still there.

@tolsen
Copy link

tolsen commented Sep 8, 2012

+1

ukinau added a commit to ukinau/fluent-plugin-elasticsearch that referenced this issue Mar 22, 2020
Description of http_backend_excon_nonblock:
 - If http_backend_excon_nonblock is true, Farday create Excon instance
 with nonblocking option which perform http request in nonblocking
 fassion
 - If http_backend_excon_nonblock is false, Fardday create Excon
 instance with blocking option which perform http request in blocking
 fassion

Special Note about http_backend_excon_nonblock:
If user use jRuby, you need to consider to configure http_backend_excon_nonblock=false.
Since you may experince some issue.
- excon/excon#106
- jruby/jruby-ossl#19

But if user is not using jRuby, you'd better to configure
http_backend_excon_nonblock=true to prvent fluent-plugine-elasticsearch
from stucking

Background:
The older version of v1.0.0(latest as of 23 March 2020)
in Fardday(https://github.com/lostisland/farada),
When we use excon(https://github.com/excon/excon) as a adapter for
https, Faraday force to configure Excon to disable nonblock due to
following jRuby specific problem
- excon/excon#106
- jruby/jruby-ossl#19

That's why currently when fluent-plugin-elasticsearch plugin connect to
Elastic Search, If it use http, Farday generate Excon instance with
nonblocking=true(default of Excon), but in the case of https, Farady
generate Excon instance with nonblocking=falase

This actually cause the problem making Farday HTTP Client stuck when SSL
Server(Elastic Search in current context) stuck during SSL Handshake
since Excon SSLSocket can not respecting to timeout, and rely on timeout
of SSL::SSLSocket in Ruby Standard Library which have exaclty process-hang
problem.

That's why sometimes flusth_thread of fluent-plugin-elasticsearch got
stuck when Elastic Search had something problem during SSL Session
handling.

Root cause of this problem is actually implementation of SSL::SSLSocket
in Ruby Standard Library(https://redmine.ruby-lang.org/issues/15729),
so better to fix Ruby side but it will take a time, and require ruby
version up, so better to provide the way to perform workaround.
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

No branches or pull requests

7 participants