You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After a period of time: Worker rq:worker: worker_1: Redis connection timeout, quitting...
ps -aux | grep "worker.py" root 344648 0.0 0.0 9036 656 pts/2 S+ 18:00 0:00 grep --color=auto worker.py It seems that all my workers have been killed. Is there any way I can ensure that the workers can automatically connect?
It seems that the while loop cannot solve this problem. I still encountered the problem of worker disconnection but not reconnection in the later stage
+1, It can be reproduced when the network with the redis server is disconnected, and it will not attempt to reconnect
but when redis process is killed, it can trigger reconnection
Hello, we ran into the same issue using rq worker --url "redis://redis" queue_name, does anyone have a solution for this? It happens both in RQ 2.1 and 1.16.2.
The only solution we have found yet is that kill the worker and restart it manually.
EDIT: After further investigation, the issue is that the worker exit with a success status, which means or docker config "on-failure" restart doesn't work. I think the worker should have an error exit code when it exits with a de-connection error.
After further investigation, the issue is that the worker exit with a success status, which means or docker config "on-failure" restart doesn't work. I think the worker should have an error exit code when it exits with a de-connection error.
This is a key point and something I've observed as well with systemd running an rq service. Restart=on-failure doesn't have any impact because the service appears to be stopping gracefully with an exit code of 0.
Log output sample:
python[997]: ERROR Worker rq:worker:584kwdgdfg36597mhn8476903nc8: Redis connection timeout, quitting...
python[2600]: INFO Scheduler stopping, releasing locks for default, high, low...
python[2600]: INFO Scheduler with PID 2600 has stopped
python[997]: INFO Unsubscribing from channel rq:pubsub:584kwdgdfg36597mhn8476903nc8
systemd[1]: rq-app.service: Deactivated successfully.
systemd[1]: rq-app.service: Consumed 49.451s CPU time.
Activity
Miracles666 commentedon Aug 29, 2023
It seems that using a while loop can solve the problem
Miracles666 commentedon Feb 22, 2024
It seems that the while loop cannot solve this problem. I still encountered the problem of worker disconnection but not reconnection in the later stage
ssikiki commentedon Mar 19, 2024
+1, It can be reproduced when the network with the redis server is disconnected, and it will not attempt to reconnect
but when redis process is killed, it can trigger reconnection
alor commentedon Apr 5, 2024
facing similar issue, and I can't understand why the try/except is not catching the exception
IngLP commentedon Feb 13, 2025
+1, same problem
lorentsi commentedon Feb 28, 2025
Hello, we ran into the same issue using
rq worker --url "redis://redis" queue_name, does anyone have a solution for this? It happens both in RQ 2.1 and 1.16.2.The only solution we have found yet is that kill the worker and restart it manually.
EDIT: After further investigation, the issue is that the worker exit with a success status, which means or docker config "on-failure" restart doesn't work. I think the worker should have an error exit code when it exits with a de-connection error.
tyler-8 commentedon Mar 18, 2025
This is a key point and something I've observed as well with
systemdrunning anrqservice.Restart=on-failuredoesn't have any impact because the service appears to be stopping gracefully with an exit code of 0.Log output sample: