I''ve seen this happen a few times during deploys/restarts, and I just got a fresh backtrace, so I thought I''d bring this up. The exception message I get is: Mongo::ConnectionFailure: Failed to connect to host xxx.yyy.zzz.com and port 12345: Interrupted system call - connect(2) Basically, it looks like unicorn is interrupting connect(2) calls when an underlying library is making a socket connection. Backtrace: https://gist.github.com/1158216 Mongo pool.rb: https://github.com/mongodb/mongo-ruby-driver/blob/1.3.1/lib/mongo/util/pool.rb I don''t know if this is a unicorn thing or a Mongo implementation problem, but I''m pretty sure I''ve seen this happen before with Net::HTTP. I''ll try to locate that error. -- alex sharp github.com/ajsharp twitter.com/ajsharp alexjsharp.com
Alex Sharp <ajsharp at gmail.com> wrote:> The exception message I get is: Mongo::ConnectionFailure: Failed to > connect to host xxx.yyy.zzz.com and port 12345: Interrupted system > call - connect(2)<snip>> I don''t know if this is a unicorn thing or a Mongo implementation > problem, but I''m pretty sure I''ve seen this happen before with > Net::HTTP. I''ll try to locate that error.This is a bug in fixed in Ruby 1.9.2-p290 (r31829 in the ruby_1_9_2 branch) -- Eric Wong
cliftonk at gmail.com
2011-Aug-19 23:49 UTC
USR2 + QUIT sometimes interrupts socket connections
On Aug 19, 2011, at 5:46 PM, Alex Sharp wrote:> The exception message I get is: Mongo::ConnectionFailure: Failed to > connect to host xxx.yyy.zzz.com and port 12345: Interrupted system > call - connect(2)I''ve been experiencing the same issue in production with fauna/memcached gem which is backed by the libmemcached C library.
> This is a bug in fixed in Ruby 1.9.2-p290 (r31829 in the ruby_1_9_2 branch)Great, thanks much. - alex
cliftonk at gmail.com wrote:> On Aug 19, 2011, at 5:46 PM, Alex Sharp wrote: > > The exception message I get is: Mongo::ConnectionFailure: Failed to > > connect to host xxx.yyy.zzz.com and port 12345: Interrupted system > > call - connect(2) > > I''ve been experiencing the same issue in production with > fauna/memcached gem which is backed by the libmemcached C library.Unlike Mongo and Net::HTTP, the memcached gem doesn''t use the standard Ruby socket library. Can you show us a backtrace (and probably Cc: Evan Weaver (fauna)) so we can get it fixed? Any process accepting signals can have system calls fail with EINTR, and buggy libraries don''t handle it properly. The Ruby standard library is mostly good at gracefully handling EINTR, and I''ve gotten all instances I''ve encountered fixed in MRI 1.9.x. -- Eric Wong
Eric Wong <normalperson at yhbt.net> wrote:> cliftonk at gmail.com wrote: > > On Aug 19, 2011, at 5:46 PM, Alex Sharp wrote: > > > The exception message I get is: Mongo::ConnectionFailure: Failed to > > > connect to host xxx.yyy.zzz.com and port 12345: Interrupted system > > > call - connect(2) > > > > I''ve been experiencing the same issue in production with > > fauna/memcached gem which is backed by the libmemcached C library. > > Unlike Mongo and Net::HTTP, the memcached gem doesn''t use the standard > Ruby socket library. Can you show us a backtrace (and probably Cc: Evan > Weaver (fauna)) so we can get it fixed?Evan said (privately to me) to open a ticket for memcached so he or Brandon can fix it. I guess https://github.com/fauna/memcached/issues ? -- Eric Wong