【发布时间】:2017-02-13 05:54:45
【问题描述】:
我有一个带有 Sidekiq 和 capistrano-sidekiq 的 Rails 5 API,在过去的几个月里它运行良好。
前几天,Sidekiq 停止处理作业。检查日志,我看到了
bundler: failed to load command: sidekiq (/home/user/project/shared/bundle/ruby/2.2.0/bin/sidekiq)
SignalException: SIGHUP
/home/user/project/shared/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/module/attribute_accessors.rb:119:in `<class:Module>'
/home/user/project/shared/bundle/ruby/2.2.0/gems/activesupport-5.0.0.1/lib/active_support/core_ext/module/attribute_accessors.rb:6:in `<top (required)>'
... (snip)
每当我尝试启动 Sidekiq 时,上面的内容都会出现在日志中。使用 quiet 命令 (USR1) 将其关闭并正常退出。
INFO: Received USR1, no longer accepting new work
我正在使用 Capistrano 进行部署,在发生这种情况之前一直运行良好。这是 Capistrano 用来启动 Sidekiq 的命令:
INFO [2aac3b89] Running $HOME/.rbenv/bin/rbenv exec bundle exec sidekiq --index 0 --pidfile /home/user/project/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /home/user/project/shared/log/sidekiq.log --daemon as user@xxx.xxx.xxx.xxx
DEBUG [2aac3b89] Command: cd /home/user/project/current && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.2.3" ; $HOME/.rbenv/bin/rbenv exec bundle exec sidekiq --index 0 --pidfile /home/user/project/shared/tmp/pids/sidekiq-0.pid --environment production --logfile /home/user/project/shared/log/sidekiq.log --daemon )
INFO [2aac3b89] Finished in 1.176 seconds with exit status 0 (successful).
发生了什么事?以及如何确保它不会在未来发生?
【问题讨论】:
标签: ruby-on-rails sidekiq capistrano3