Heroku cedar stack 上的 Resque 在工作进程终止后工作进程计数仍然存在
我已成功在 heroku cedar stack 上运行 resque 并将接口安装在导轨上。
当我启动工人时,一切正常。工人处理工作。但是当我杀死该工人时,Resque 仍然认为该工人可用。当我启动另一个工作程序时,它会认为有 2 个工作程序,但实际上只有一个正在运行。
我还注意到heroku发送的表格http://devcenter.heroku.com/articles/ps SIGTERM 杀死一个工作进程时,如果它没有终止,那么它会发送 SIGKILL。
这是我的工作日志
2011-08-11T02:32:45+00:00 heroku[worker.1]: Starting process with command `bundle exec rake resque:work QUEUE=*`
2011-08-11T02:32:46+00:00 heroku[worker.1]: State changed from starting to up
2011-08-11T02:33:58+00:00 heroku[worker.1]: State changed from up to stopping
2011-08-11T02:34:00+00:00 heroku[worker.1]: Stopping process with SIGTERM
2011-08-11T02:34:09+00:00 heroku[worker.1]: Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM
2011-08-11T02:34:09+00:00 heroku[worker.1]: Stopping process with SIGKILL
2011-08-11T02:34:11+00:00 heroku[worker.1]: Process exited
,我发现我的进程需要 10 多秒才能终止。这与我在工作任务上加载 Rails 环境有什么关系吗?
这是我的 rake 任务 lib/tasks/resque.rake
require "resque/tasks"
task "resque:setup" => :environment
I have successfully run resque on heroku cedar stack and mount the interface on rails.
when I start the worker, Everything works fine. The worker process the job. But When i kill the worker, Resque still think that the worker is available. When I start another worker, it then think there are 2 worker but in fact there is only one running.
I also notice form here http://devcenter.heroku.com/articles/ps that heroku send SIGTERM when killing a worker and if that does not terminate then it send SIGKILL.
here is my worker logs
2011-08-11T02:32:45+00:00 heroku[worker.1]: Starting process with command `bundle exec rake resque:work QUEUE=*`
2011-08-11T02:32:46+00:00 heroku[worker.1]: State changed from starting to up
2011-08-11T02:33:58+00:00 heroku[worker.1]: State changed from up to stopping
2011-08-11T02:34:00+00:00 heroku[worker.1]: Stopping process with SIGTERM
2011-08-11T02:34:09+00:00 heroku[worker.1]: Error R12 (Exit timeout) -> Process failed to exit within 10 seconds of SIGTERM
2011-08-11T02:34:09+00:00 heroku[worker.1]: Stopping process with SIGKILL
2011-08-11T02:34:11+00:00 heroku[worker.1]: Process exited
I see that my process takes more then 10s to terminate. Is this have anything to do because I load up rails environment on the worker task ?
this is my rake task lib/tasks/resque.rake
require "resque/tasks"
task "resque:setup" => :environment
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
ahmy,
根据您的解决方案,我想出了一个不涉及分叉 resque 的解决方案。
我将其放入
resque.rake
:并将其放入
Profile
:并将其放入
Gemfile
:ahmy,
Based on your solution, I came up with one that doesn't involve forking resque.
I put this in
resque.rake
:and put this in the
Profile
:and put this in the
Gemfile
:我刚刚发现问题,这是在 rake 任务上传递
ENV
时发生的。就像传递QUEUE='*'
时一样。这是更完整的问题
https://github.com/defunkt/resque/issues/319#issuecomment-1789239
并且该问题仍在讨论 https://github.com/defunkt/resque/issues/368
任何我的临时补丁,使 resque 只运行所有 que。
https://github.com/yulrizka/resque
I just found out the problem, this happend when passing
ENV
on the rake task. like when passingQUEUE='*'
.Here is the issue more complete
https://github.com/defunkt/resque/issues/319#issuecomment-1789239
and the issue are still in discus at https://github.com/defunkt/resque/issues/368
any my temporary patch, that make resque only run all que.
https://github.com/yulrizka/resque