Heroku雪松堆栈上的Resque工人终止后,工人计数仍然存在

编程入门 行业动态 更新时间:2024-10-27 12:36:01
本文介绍了Heroku雪松堆栈上的Resque工人终止后,工人计数仍然存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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

我也注意到这里 devcenter.heroku/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 ='*'。

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

这个问题仍然存在于 github/defunkt/resque/issues/368

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

github/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 devcenter.heroku/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 github/defunkt/resque/issues/319#issuecomment-1789239

and the issue are still in discus at github/defunkt/resque/issues/368

any my temporary patch, that make resque only run all que.

github/yulrizka/resque

更多推荐

Heroku雪松堆栈上的Resque工人终止后,工人计数仍然存在

本文发布于:2023-10-16 05:14:39,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1496602.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:工人   堆栈   雪松   Heroku   Resque

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!