-1

We have a rolling-restart mode for our mongrel cluster that sends a USR2 signal to each running process.

This works great, most of the time. But very occasionally the mongrel process will shutdown, and then fail to restart, with the following error:

/usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/tcphack.rb:12:in `initialize_without_backlog': Address already in use - bind(2) (Errno::EADDRINUSE)
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/tcphack.rb:12:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:93:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel.rb:93:in `initialize'
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:139:in `new'
from /usr/local/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:139:in `listener'

Looking though the mongrel source, the USR2 handler calls a synchronous stop on the running server, so it ought to block until the socket has been released.

Has anyone seen this error?

Does anyone have any ideas what might cause it?

(I asked this question over on StackOverflow initially, but thought it might be more appropriate here)

1 Answers1

0

I have the same error... I don't know why.

It seems that my mongrels randomly, on restart or whatever, keep their ports open and fail to start again. At first I tough it could be a monit error, then I changed it for god, and the same still happening...

  • I think I've eradicated this problem, or at least it stopped happening so frequently, when I upgraded ruby and a lot of other packages in my freebsd server. – Tiago Scolari Jul 22 '10 at 13:47