Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)

share|improve this question

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...

share|improve this answer
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.