开发者

Sending USR2 to mongrel_rails sometimes results in an "Address already in use" on the restart

开发者 https://www.devze.com 2022-12-09 13:16 出处:网络
We have a rolling-restart mode for our mongrel cluster that sends a USR2 signal to开发者_如何学编程 each running process.

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消