-
Notifications
You must be signed in to change notification settings - Fork 11.4k
5.4 Queue:work fails if Mysql server restarts or reloads (using supervisord) #19242
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
Don't use the database queue driver in production, this was discussed multiple times you can look into previous issues. I recommend that you use redis instead. Update Try to avoid using the database queue driver when you're having a large queue, it's recommended that you use something like Redis which doesn't have the deadlock problems a database-based driver has. |
@stevevg - can you try manually doing the 3 changes in this PR - and see if it fixes your problem? https://github.com/laurencei/framework/commit/a5c73220c8ef94eadb0b44769786fa52f35edf97 Please let me know. If it fixes it - I'll submit the PR. |
@themsaid ... whaaaaat? Aren't the database queue driver production worthy? Can you please provide links to the issues where this was discussed/mentioned? The documentation totally fails to mention that the database driver is in any way less stable than any of the other choices (except, of course, the |
@laurencei Your patch seems to do the job. If I restart mysql service, the laravel-worker process in supervisor gets killed, automatically restarted, and is then able to reconnect to mysql, once it comes back online. |
@stevevg - PR has been merged. Once the version is tagged you can use that. |
Thanks @laurencei @sisve I suggest that you read the conversation in this issue, starting with #7046 (comment) |
@themsaid There's a big leap going from (para-phrasing) "the database-based queue driver will run into deadlock issues when you increase the number of workers" or "it scales badly" to "don't use the database queue driver in production". This issue does not mention a heavy wor 8433 kload. In fact, Taylor says in the thread you linked that "The database driver is primarily useful in local development environments or in small production environments" (Ref: #7046 (comment)) Small production environments are still a production environments. Heck, Laravel doesn't support concurrent requests to the same session, and still we don't go around saying "don't use sessions in production"... right? (Ref: #14385) So, would you consider editing your previous statement/comment and perhaps rephrase it to something like "try avoiding the database worker for heavy workloads and look into redis instead"? |
@sisve done :) Thanks for helping me phrase it better. |
Uh oh!
There was an error while loading. Please reload this page.
Description:
Note: might be related to #19072, but is not a duplicate, since this is not fixed by #19080.
Using supervisor, when mysql connection is lost, the queue worker stops working and the following is logged to
laravel.log
:Steps To Reproduce:
Add laravel-worker command to supervisor, as per documentation, for example mine is:
command=/opt/plesk/php/7.0/bin/php /var/www/vhosts/my-domain.com/subdomains/dev/area/artisan queue:work --tries=3
Then restart or reload mysql:
service mysqld reload
or
service mysqld restart
Now, despite supervisor is still running laravel-worker...
...running
strace -p 62316
I get:write(6, "[2017-05-17 15:52:36] dev.ERROR:"..., 4253) = 4253
(File descriptor 6 is
laravel.log
, and this writes the errors I pasted above).I was running Laravel 5.4.16, which had this issue, updated to 5.4.23 after reading about fix #19080, but the issue is still here.
The text was updated successfully, but these errors were encountered: