2006 MySQL server has gone away in queue:work scenario #51895
Replies: 2 comments
-
The queue system will detect lost connections and remake it - this isn't a bug report btw. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi. Bear in mind that database driver for workers in multi worker situation is not working smooth because of the locks. I had to switch to sqs because of that. Also supervisord is restarting the worker after it is stopped by SIGTERM and BEFORE the container is stopped in a deploy or scale down situation. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Laravel Version
10.4.1
PHP Version
8.1.4
Database Driver & Version
mysql 8.0
Description
In MySQL configuration, there is a parameter called "wait_timeout", this parameter means roughly like this: when a client connects to MySQL database, if the client doesn't disconnect itself and doesn't do any operation, MySQL database will keep this connection "wait_timeout" for such a long time (in s, default is 28800s, i.e. 8 hours). (unit is s, default is 28800s, that is, 8 hours), after this time, MySQL database will disconnect the connection in order to save resources; of course, during this process, if the client has any operation on this connection, MySQL database will start calculating this time again.
Yesterday, I used supervisor to do process management for queues, using queue:work, and a question came to mind: queue:work runs all the time, so if there are no tasks for a long period of time, does it send a timeout to the database connection? In the current scenario, I found that the error "2006 MySQL server has gone away" appears occasionally, but it is normal to check the database, I am currently using version 10.x, and after checking the source code, I found that there is a way to recheck whether the database has been connected, but I found that it does not work. What is the problem?
Steps To Reproduce
in queue scenario
Beta Was this translation helpful? Give feedback.
All reactions