unicorn Ruby/Rack server user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
* USR2 + QUIT sometimes interrupts socket connections
@ 2011-08-19 22:46 Alex Sharp
  2011-08-19 23:47 ` Eric Wong
  2011-08-19 23:49 ` cliftonk
  0 siblings, 2 replies; 6+ messages in thread
From: Alex Sharp @ 2011-08-19 22:46 UTC (permalink / raw)
  To: unicorn list

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
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USR2 + QUIT sometimes interrupts socket connections
  2011-08-19 22:46 USR2 + QUIT sometimes interrupts socket connections Alex Sharp
@ 2011-08-19 23:47 ` Eric Wong
  2011-08-20  0:04   ` Alex Sharp
  2011-08-19 23:49 ` cliftonk
  1 sibling, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-08-19 23:47 UTC (permalink / raw)
  To: unicorn list

Alex Sharp <ajsharp@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
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USR2 + QUIT sometimes interrupts socket connections
  2011-08-19 22:46 USR2 + QUIT sometimes interrupts socket connections Alex Sharp
  2011-08-19 23:47 ` Eric Wong
@ 2011-08-19 23:49 ` cliftonk
  2011-08-20  0:11   ` Eric Wong
  1 sibling, 1 reply; 6+ messages in thread
From: cliftonk @ 2011-08-19 23:49 UTC (permalink / raw)
  To: unicorn list

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.
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USR2 + QUIT sometimes interrupts socket connections
  2011-08-19 23:47 ` Eric Wong
@ 2011-08-20  0:04   ` Alex Sharp
  0 siblings, 0 replies; 6+ messages in thread
From: Alex Sharp @ 2011-08-20  0:04 UTC (permalink / raw)
  To: unicorn list

> This is a bug in fixed in Ruby 1.9.2-p290 (r31829 in the ruby_1_9_2 branch)

Great, thanks much.

- alex
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USR2 + QUIT sometimes interrupts socket connections
  2011-08-19 23:49 ` cliftonk
@ 2011-08-20  0:11   ` Eric Wong
  2011-08-20  7:37     ` Eric Wong
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Wong @ 2011-08-20  0:11 UTC (permalink / raw)
  To: unicorn list

cliftonk@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
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: USR2 + QUIT sometimes interrupts socket connections
  2011-08-20  0:11   ` Eric Wong
@ 2011-08-20  7:37     ` Eric Wong
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Wong @ 2011-08-20  7:37 UTC (permalink / raw)
  To: unicorn list

Eric Wong <normalperson@yhbt.net> wrote:
> cliftonk@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
_______________________________________________
Unicorn mailing list - mongrel-unicorn@rubyforge.org
http://rubyforge.org/mailman/listinfo/mongrel-unicorn
Do not quote signatures (like this one) or top post when replying


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-08-20  7:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-19 22:46 USR2 + QUIT sometimes interrupts socket connections Alex Sharp
2011-08-19 23:47 ` Eric Wong
2011-08-20  0:04   ` Alex Sharp
2011-08-19 23:49 ` cliftonk
2011-08-20  0:11   ` Eric Wong
2011-08-20  7:37     ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/unicorn.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).