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

worker never reconnect to redis server #180

Open
kochizufan opened this issue Apr 15, 2014 · 5 comments
Open

worker never reconnect to redis server #180

kochizufan opened this issue Apr 15, 2014 · 5 comments

Comments

@kochizufan
Copy link

I run php-rescue's workers and shutting down redis server.
Then start redis again server.

workers are not down their process, but they aren't reconnect to redis server again.
If workers stop when redis is down, it can recovery again by some deamonizer tools,
but now, I have nothing to do with this problem.

Is there any solution to reconnect php-resque worker to recovered redis server?

@danhunsaker
Copy link
Contributor

That's odd. Credis's PHP implementation should try to reconnect automatically any time the worker interval passes, at least. Or crash; Credis has a bad habit of doing that when things go wrong. If the php-redis extension is installed, it should automatically reconnect at the interval without any help from Credis at all. So the fact this doesn't seem to be happening either way is... Well, as I said, that's odd.

Since we expect the Redis library (Credis or php-redis) to handle reconnection as needed, we don't have any checks to ensure the connection is still established, nor to reestablish that connection ourselves. If the library is failing to handle reconnect properly on its own, as in your case, we will need to implement such checks and reconnects to address that. I will attempt to recreate the issue on my system and check back in with more info when I have.

@jesusch
Copy link

jesusch commented Apr 23, 2015

I have the same problem. It's quite simple to reproduce.

start a worker - generate a job - job is done
restart redis (ensure that it really was down)
generate a job - working is doing nothing but it teels in the logfile that it checks for jobs

I'd suggest using the redis()->ping() method and try to trigger a reconnect if possible

@jesusch
Copy link

jesusch commented Apr 23, 2015

btw - even a dead worker would be better that something that looks like it is alive (for moniting checks / daemontools)

@lucups
Copy link

lucups commented Oct 8, 2015

I have the same problem. I think we should create a process to inspect the connection.

@danhunsaker
Copy link
Contributor

PRs are always welcome.

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

4 participants