Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

any to shutdown a worker without warm? #242

Closed
yishenggudou opened this issue Aug 8, 2013 · 8 comments
Closed

any to shutdown a worker without warm? #242

yishenggudou opened this issue Aug 8, 2013 · 8 comments

Comments

@yishenggudou
Copy link

yishenggudou commented Aug 8, 2013

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

@yishenggudou
Copy link
Author

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.

@nvie
Copy link
Collaborator

nvie commented Jul 24, 2014

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.

@nvie nvie closed this as completed Jul 24, 2014
@omidraha
Copy link

omidraha commented Dec 3, 2016

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

@ericpascual
Copy link

Same problem here.

@jbaiter
Copy link

jbaiter commented Jan 26, 2017

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.

@italomaia
Copy link

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

@nicbou
Copy link

nicbou commented Jan 28, 2018

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 &

@samuelcolvin
Copy link
Member

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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants