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?

Ben
  • 226
  • 2
  • 4
  • Are you using mongrel_rails cluster::restart or just sending the USR2 to the processes via some other means? – rnicholson Nov 01 '09 at 15:17
  • I'm sending the signal via kill: $ kill -USR2 [mongrel_process_id] This is how we do a rolling restart -- we wait a few seconds before sending the signal to each successive mongrel. – Ben Nov 01 '09 at 21:56
  • Have you found a solution for this? – marcosbeirigo Dec 11 '12 at 13:18

0 Answers0