-
Notifications
You must be signed in to change notification settings - Fork 11.4k
Queue:work fails. MySQL server has gone away #19005
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
Comments
Some things to consider: 1st: Looking at 2nd: The daemon process never die. Since the connection is lost for any reason and Laravel doesn't reconnect, the daemon process should exit with any error code, forcing the 3rd: I did tested put the entire code inside a |
Have you tried this on a 5.4 application? There was some refactoring on how queues & database connections work under the hood by Taylor - so it might be fixed in 5.4? |
@laurencei Didn't tried yet, I've spend some days migrating the application from 5.2 to 5.3 just to get this issue fixed, with no success. |
I was looking at the code there for Please upgrade to |
Please upgrade since 5.3 is not supported anymore. |
@themsaid There's no fix for this issue in 5.4 too... |
same problem here... |
@tpharaoh What version are you using? |
5.4 |
I restarted my queue and it worked. Not sure what caused it in the first place |
@tpharaoh Restarting the queue is just an workaround to fix the issue. Everytime that your mysql server become unavailable, your queue will stop working until you manually restart it. That's the issue |
A temporary workout would be to use |
@laurencei Yes, it works but is slower and consume more resources from the server. 😔 |
@laurencei Sorry for nagging on old topic,but now I have a 5.3 with this issue, and I can't upgrade it for a month or so. |
I dont know if you can run |
@tpharaoh Using queue:listen solve the issue on 5.3, but I'm not sure about how to do it on forge. |
Just had the same on my production server. Everything went okay for a few weeks until suddenly it started firing. Guess we're updating to 5.4 |
Description:
The issue looks like the same issue addressed by #15179 but on L5.3.
I have 3 Queue Workers running, monitored by supervisord.
My MySQL server run on another droplet under same private network.
If the connection is lost any reason, the queue worker doesn't try to reconnect as expected, and keep logging errors infinitely:
Steps To Reproduce:
php artisan queue:work database --sleep=1 --tries=3
The text was updated successfully, but these errors were encountered: