From: Mohamed Hafez Date: 2016-05-30T09:18:36-07:00 Subject: [ruby-core:75774] Errno::EAGAIN thrown by OpenSSL::SSL::SSLSocket#connect_nonblock --===============0618619631== Content-Type: multipart/alternative; boundary=001a113f9994d37c6b0534119bf6 --001a113f9994d37c6b0534119bf6 Content-Type: text/plain; charset=UTF-8 Hi all, every now and then in my production server, I'm getting Errno::EAGAIN errors thrown by by OpenSSL::SSL::SSLSocket#connect_nonblock from at https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L938 I'm using JRuby, so initially I assumed it was just a JRuby implementation bug and that MRI's OpenSSL::SSL::SSLSocket#connect_nonblock must handle Errno::EAGAIN internally, but now that I think about it, the only way to handle Errno::EAGAIN is to wait for a bit and then retry, and connect_nonblock isn't supposed to block so how would it do that.... Since this only happens once in a while in production, I don't actually have a way of seeing if MRI Ruby will also throw this error, but I can't see how it wouldn't if connect_nonblock can't block for a while before retrying, but let me know if I'm wrong. If I am correct, could I submit a pull request to catch Errno::EAGAIN at https://github.com/ruby/ruby/blob/trunk/lib/net/http.rb#L938 and then retry? Thanks! Mohamed --001a113f9994d37c6b0534119bf6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi all, every now and then in my production server, I'= m getting=C2=A0Errno::EAGAIN errors thrown by by OpenSSL::SSL::SSLSocket#co= nnect_nonblock=C2=A0from at=C2=A0https://github.com/ruby/ruby/blob/trunk/lib/= net/http.rb#L938

I'm using JRuby, so initially I= assumed it was just a JRuby implementation bug and that MRI's =C2=A0Op= enSSL::SSL::SSLSocket#connect_nonblock must handle=C2=A0Errno::EAGAIN inter= nally, but now that I think about it, the only way to handle Errno::EAGAIN = is to wait for a bit and then retry, and connect_nonblock isn't suppose= d to block so how would it do that....

Since this = only happens once in a while in production, I don't actually have a way= of seeing if MRI Ruby will also throw this error, but I can't see how = it wouldn't if connect_nonblock can't block for a while before retr= ying, but let me know if I'm wrong. If I am correct, could I submit a p= ull request to catch=C2=A0Errno::EAGAIN at https://github.com/ruby/ruby/blob/= trunk/lib/net/http.rb#L938 and then retry?

Tha= nks!
Mohamed
--001a113f9994d37c6b0534119bf6-- --===============0618619631== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Unsubscribe: --===============0618619631==--