简体   繁体   English

Resque:工人状态不对

[英]Resque: worker status is not right

Resque is currently showing me that I have a worker doing work on a queue. Resque 目前正在向我展示我有一个工人在处理队列。 That worker was shutdown by me in the middle of the queue (it's just for testing) and the worker is still showing as running.该工作人员在队列中间被我关闭(仅用于测试)并且工作人员仍显示为正在运行。 I've confirmed the process ID has been killed and bluepill is no longer monitoring it.我已经确认进程 ID 已被杀死并且 bluepill 不再监视它。 I can't find anyway in the UI to force clear that it is working.我无法在 UI 中找到任何方式来强制清除它正在工作。

What's the best way to update the status for the # of workers that are currently up (I have 2, web UI reports 3).更新当前工作的工作人员数量的最佳方式是什么(我有 2 个,Web UI 报告 3 个)。

You may have a lingering pid file.您可能有一个挥之不去的 pid 文件。 This file is independent of the process running;该文件独立于正在运行的进程; in other words, when you killed the process, it didn't delete the pid file.换句话说,当你终止进程时,它并没有删除 pid 文件。

If you're using a typical Rails and Resque setup, Resque will store the pid in the Rails ./tmp directory.如果您使用典型的 Rails 和 Resque 设置,Resque 会将 pid 存储在 Rails 的 ./tmp 目录中。

Some Resque start scripts specify the pid file in a different location, something like this:一些 Resque 启动脚本在不同的位置指定 pid 文件,如下所示:

PIDFILE=foo/bar/resque/pid bundle exec rake resque:work 

Wherever the script puts the pid file, look there, then delete it, then restart.无论脚本将 pid 文件放在哪里,请查看那里,然后将其删除,然后重新启动。

Also on the command line, you can ask redis for the running workers:同样在命令行上,您可以向 redis 询问正在运行的工作人员:

redis-cli keys *worker:*

If there are workers that you don't expect, you can delete them with:如果有您不期望的工作人员,您可以使用以下命令删除它们:

redis-cli del <keyname>

尝试重新启动应用程序。

供将来参考:也可以查看https://github.com/resque/resque/issues/299

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM