-
Notifications
You must be signed in to change notification settings - Fork 137
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
Is there a way to make a gearman PHP worker dont die if a server is not available? #344
Comments
What language are your workers implemented in? C? What version of gearmand are you using? Does this happen using the This hasn't been my experience, but my workers are all implemented in Perl using this library. They don't die when gearmand is restarted and they automatically reconnect. I'm pretty sure that's true of PHP workers also. |
Interesting, first time running gearman on the cli. Your were correct. if I run the worker and the kill gearman I get and infinate message And when I start gearmand again, the process still there. So it seems that the problem is the php client library(maybe) I am using gearmand 1.1.19.1+ds - if I run the reverse example from gearman.org. It dies as soon as I stop gearmand I am using PHP root@test1:~/test# php -f worker.php |
I'm surprised to hear that PHP workers die when gearmand is stopped/killed. It might be a problem with the PHP Gearman library? Are you using https://github.com/php/pecl-networking-gearman/ ? Did you compile and install it yourself? We have PHP Gearman clients at my job, but no workers are implemented in PHP, so I have no idea if this is expected behavior or not. |
I am using Ubuntu. All I did to install gearman was I checked the sources list and it has this line deb http://ppa.launchpad.net/ondrej/pkg-gearman/ubuntu bionic main |
I did some googling, and I found some things that might help: https://stackoverflow.com/questions/14749576/gearman-throws-gearman-could-not-connect-on-php-example The answer in that second link has a more complicated Also, you might try asking on the Gearman mailing list: https://groups.google.com/g/gearman/ |
Thank you for the help. But nothing seems to work. What I am doing that other people do , is having a monitor so that when it dies, the monitor creates the workers again. I will contact the gearman mailing list Thank you |
I would like to create a worker that if gearman server is not running, that the worker just try to reconnects in X amount of seconds.
The problem that I have is that if I have 10 workers listening and I restart the gearman server, all the workers die, instead of waiting for gearman server to comeback.
Thank you
The text was updated successfully, but these errors were encountered: