Heroku cedar stack 上的 Resque 在工作进程终止后工作进程计数仍然存在

发布于 2024-11-29 00:42:14 字数 1177 浏览 0 评论 0原文

我已成功在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

固执像三岁 2024-12-06 00:42:15

ahmy,

根据您的解决方案,我想出了一个不涉及分叉 resque 的解决方案。

我将其放入 resque.rake

task "resque:setup" => :environment do
  ENV['QUEUE'] = '*'
end

并将其放入 Profile

worker:  bundle exec rake resque:work

并将其放入 Gemfile

gem 'resque', :git => 'git://github.com/defunkt/resque.git'

ahmy,

Based on your solution, I came up with one that doesn't involve forking resque.

I put this in resque.rake:

task "resque:setup" => :environment do
  ENV['QUEUE'] = '*'
end

and put this in the Profile:

worker:  bundle exec rake resque:work

and put this in the Gemfile:

gem 'resque', :git => 'git://github.com/defunkt/resque.git'
鲸落 2024-12-06 00:42:14

我刚刚发现问题,这是在 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 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文