我有一个Rails 5 API,带有Sidekiq和capistrano sidekiq,在过去的几个月里一直很好地工作。
前几天,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时,上面的内容就会出现在日志中。它使用静音命令(USR1)关闭并正确退出。
INFO: Received USR1, no longer accepting new work我正在使用Capistrano进行部署,在这种情况发生之前,它一直运行良好。以下是启动Sidekiq的命令Capistrano:
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).怎么一回事?我怎样才能保证以后不会发生这种事呢?
发布于 2017-02-13 06:14:28
在卡皮斯特拉诺,我让:pty设置为true。我猜它还没来得及启动就已经扼杀了这个过程。我仍然不知道为什么现在这是一个问题,但是将:pty设置为false似乎已经做到了这一点。
https://stackoverflow.com/questions/42197476
复制相似问题