Rq: any to shutdown a worker without warm?

Created on 8 Aug 2013  路  8Comments  路  Source: rq/rq

I use supervisor to manage my rq worker
and my supervisor conf is like this

[program:rq-upload]
command=rqworker -H 10.182.63.61 -P /data/CDN_DATA_ANA/log/letvlog --name=10.180.153.80_re_upload_%(process_num)s log_upload_10.180.153.80
directory=/data/CDN_DATA_ANA/log/log
stopsignal=TERM
autorestart=true
autostart = true
startsecs = 5
process_name = rq_upload%(process_num)s
numprocs=2
user = root
redirect_stderr = true
stdout_logfile = /logs/rq-upload.log

But when I restart use supervisorctl -c /etc/supervisord.conf update re-upload:*
It always tell me the worker name has used

Most helpful comment

I have the same issue, when i stop rqworker from the docker-compose running command by Ctrl+c and want to start it again.

worker_1  |   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
worker_1  |     return ctx.invoke(self.callback, **ctx.params)
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
worker_1  |     return callback(*args, **kwargs)
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/rq/cli/cli.py", line 206, in worker
worker_1  |     w.work(burst=burst)
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 431, in work
worker_1  |     self.register_birth()
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 251, in register_birth
worker_1  |     raise ValueError(msg.format(self.name))
worker_1  | ValueError: There exists an active worker named u'5d36705967ac.22' already

All 8 comments

Traceback (most recent call last):
  File "/usr/bin/rqworker", line 9, in <module>
    load_entry_point('rq==0.3.8', 'console_scripts', 'rqworker')()
  File "/usr/lib/python2.6/site-packages/rq/scripts/rqworker.py", line 84, in main
    w.work(burst=args.burst)
  File "/usr/lib/python2.6/site-packages/rq/worker.py", line 294, in work
    self.register_birth()
  File "/usr/lib/python2.6/site-packages/rq/worker.py", line 197, in register_birth
    'already.' % (self.name,))
ValueError: There exists an active worker named '10.181.153.149_rq_13' already.

I'm closing old issues. If this issue still applies and requires my attention, I ask you kindly to re-open it or file a new issue. Thanks.

I have the same issue, when i stop rqworker from the docker-compose running command by Ctrl+c and want to start it again.

worker_1  |   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 889, in invoke
worker_1  |     return ctx.invoke(self.callback, **ctx.params)
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 534, in invoke
worker_1  |     return callback(*args, **kwargs)
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/rq/cli/cli.py", line 206, in worker
worker_1  |     w.work(burst=burst)
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 431, in work
worker_1  |     self.register_birth()
worker_1  |   File "/usr/local/lib/python2.7/dist-packages/rq/worker.py", line 251, in register_birth
worker_1  |     raise ValueError(msg.format(self.name))
worker_1  | ValueError: There exists an active worker named u'5d36705967ac.22' already

Same problem here.

Same problem here, I work around it by just issuing two SIGINT signals to the worker instead of leaving the killing of the process the supervisor process (docker-compose in my case). This makes the worker shutdown cleanly.

docker-compose run worker-service
then CTRL+C
Works for me.

I have the same problem, but I start rq as a background process, so italomaia's fix does not apply. Is there a way to work around this?

rq worker $RQ_WORKER_NAME -u $REDIS_DB_URL &

yes, just send it a standard kill signal.

ps -aux | grep "rq worker"

then take the process id (the second number) and execute

kill <proc id>
Was this page helpful?
0 / 5 - 0 ratings

Related issues

sivabudh picture sivabudh  路  4Comments

mitakuye picture mitakuye  路  7Comments

willvousden picture willvousden  路  7Comments

nvie picture nvie  路  3Comments

anduingaiden picture anduingaiden  路  6Comments