Heroku雪松堆栈上的Resque工人终止后,工人计数仍然存在 [英] Resque on Heroku cedar stack Worker count still exists after the worker terminate

查看:127
本文介绍了Heroku雪松堆栈上的Resque工人终止后,工人计数仍然存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我启动worker时,一切运行良好。

我已经成功地在heroku雪松堆栈上运行resque并将接口安装在rails上。工作人员处理这项工作。但是当我杀死工人时,Resque仍然认为工人是可用的。当我开始另一名工人时,它认为有2名工人,但实际上只有一名工人。



我也注意到这里 http://devcenter.heroku.com/articles/ps 当杀死一名工人时,heroku发送SIGTERM,如果那不终止,那么它发送SIGKILL。



这是我的工作日志

  2011-08 -11T02:32:45 + 00:00 heroku [worker.1]:用命令`bundle exec rake resque:work QUEUE = *`
2011-08-11T02:32:46 + 00:00启动进程heroku [worker.1]:状态从开始变为变化
2011-08-11T02:33:58 + 00:00 heroku [worker.1]:状态从最初变为停止
2011-08- 11T02:34:00 + 00:00 heroku [worker.1]:用SIGTERM
停止进程2011-08-11T02:34:09 + 00:00 heroku [worker.1]:错误R12(退出超时) - > SIGTERM
2011-08-11T02:34:09 + 00:00 heroku [worker.1]:使用SIGKILL停止进程
2011-08-11T02:34:11 +00:00 heroku [worker.1]:进程已退出

我发现我的进程需要更多10s终止。这是否有什么要做,因为我在worker任务上加载rails环境?



这是我的rake任务 lib / tasks / resque.rake

  requireresque / tasks

taskresque:setup => :environment


解决方案

我刚发现问题,当在rake任务上传递 ENV 时。例如当传递 QUEUE ='*'



以下是更完整的问题
https://github.com/defunkt/resque/issues/319#issuecomment-1789239



这个问题仍然存在于 https://github.com/defunkt/resque/issues/368



任何我的临时补丁,这使得resque只运行所有que。 p>

https://github.com/yulrizka/resque


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

解决方案

I just found out the problem, this happend when passing ENV on the rake task. like when passing QUEUE='*'.

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

这篇关于Heroku雪松堆栈上的Resque工人终止后,工人计数仍然存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆