-
Notifications
You must be signed in to change notification settings - Fork 422
Allow laravel to end workers with lost connection #457
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
Conversation
…stConnections::causedByLostConnection It should throw exception with special message in order to end queue on error correctly. Otherwise, it continues to work with broken connection.
it fixes the issue ! |
It's solve the issue but still sometime lost connection. |
This fix is not to prevent lost connection - it can happen because of network or something else. When connection is lost Laravel worker should restart queue. But with rabbitmq it doesn't do it. It just continue to work with lost connection, spamming errors. This fix makes Laravel work with queue properly and restart it. |
This is what im looking for ... |
Did this code helps someone? Now i inject this code in my project and after 2-3 days i will tell my result. |
I'am an author of this. You better not inject, but use this: #436 (comment) For my projects it works fine for 2 months. It, ofcource, doesn't prevent lost connection to rabbit. But worker get restarted by laravel as it was intended. |
@vyuldashev please review |
@vyuldashev , please review |
Morning! Do anyone know when this will be reviewed? |
@vyuldashev please review. We need it. |
Sorry, I am a little bit busy at the moment. Thanks for the contribution. Released under v12.0.1 |
Thanks a lot! |
Any chance you can support 11.x version? Thank you again! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
@@ -254,6 +257,16 @@ public function pop($queue = null) | |||
} | |||
|
|||
throw $exception; | |||
} catch (AMQPChannelClosedException|AMQPConnectionClosedException $exception) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏻
Exception thrown by ::pop is checked by Illuminate\Database\DetectsLostConnections::causedByLostConnection
It should throw exception with special message in order to end queue on error correctly.
Otherwise it continues to work with broken connection.
#421
#436