You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello. I´ve been having some trouble with supervisor and queues recently. I am using the database driver.
Laravel 5.2 / SqlServer
SHUTDOWN IN PROGRESS
A few months ago, sometimes the database entered in "SHUTDOWN IN PROGRESS" and when the supervisor tried to check the jobs table if any job was waiting to be processed, an exception was thrown. This behavior is expected. But, after the database returned to the usual state, supervisor or the worker continued to getting the same exceptions when it tried to check the jobs table. And because the jobs table is checked continually, this started to throw thousands of errors in a few hours.
Laravel 5.4 / MySql
DEADLOCK FOUND
A few days ago, (other app), that also uses the queues, supervisor and database driver, was having trouble. It seems that supervisor can´t dispatch jobs and insert the data in the jobs table because of the way laravel dispatches jobs. Doing some research, it seems that when I dispatch a job, the jobs table entries in some deadlock and this is an expected behavior (More info about deadlocks here). But when the exception was thrown, its like supervisor or the worker got stuck again and again on any other attempts to dispatch new jobs, this very same exception was thrown.
DIRTY SOLUTION:
For the app with laravel 5,2 I did something dirty. In my app/exceptions/Handler.php, I check every exception that is thrown. If the exception is about "SHUTDOWN IN PROGRESS", Y execute shell_exec with the "sudo service supervisor restart" and supervisor or workers, stopped getting this kind of exception and it everything was fine again and all jobs that was waiting in the table, were processed fine.
For the app with laravel 5,4 I haven´t done anything yet. But it was weird. The deadlock was thrown over and over again everytime I tried to dispatch new jobs. But from a terminal, I ran manually "sudo service supervisor restart" and again, everything was working fine again.
So:
In both cases, the problem was that the supervisor or the worker got stuck in the same exception even when the real cause was overcome.
In both cases, the solution was to restart the supervisor service.
So why the supervisor got stuck in the first exception and stopped working? or is it the worker?
why does the solutions go away when the restarting the supervisor service?
The text was updated successfully, but these errors were encountered:
One thing to note, the database queue driver is not recommending for an app with many workers, it should be used only in small apps and in-development since there are lots of problems involved with DB connectivity and deadlocks.
This problem occurs to me in two apps
Description:
Hello. I´ve been having some trouble with supervisor and queues recently. I am using the database driver.
Laravel 5.2 / SqlServer
SHUTDOWN IN PROGRESS
A few months ago, sometimes the database entered in "SHUTDOWN IN PROGRESS" and when the supervisor tried to check the jobs table if any job was waiting to be processed, an exception was thrown. This behavior is expected. But, after the database returned to the usual state, supervisor or the worker continued to getting the same exceptions when it tried to check the jobs table. And because the jobs table is checked continually, this started to throw thousands of errors in a few hours.
Laravel 5.4 / MySql
DEADLOCK FOUND
A few days ago, (other app), that also uses the queues, supervisor and database driver, was having trouble. It seems that supervisor can´t dispatch jobs and insert the data in the jobs table because of the way laravel dispatches jobs. Doing some research, it seems that when I dispatch a job, the jobs table entries in some deadlock and this is an expected behavior (More info about deadlocks here). But when the exception was thrown, its like supervisor or the worker got stuck again and again on any other attempts to dispatch new jobs, this very same exception was thrown.
DIRTY SOLUTION:
For the app with laravel 5,2 I did something dirty. In my app/exceptions/Handler.php, I check every exception that is thrown. If the exception is about "SHUTDOWN IN PROGRESS", Y execute shell_exec with the "sudo service supervisor restart" and supervisor or workers, stopped getting this kind of exception and it everything was fine again and all jobs that was waiting in the table, were processed fine.
For the app with laravel 5,4 I haven´t done anything yet. But it was weird. The deadlock was thrown over and over again everytime I tried to dispatch new jobs. But from a terminal, I ran manually "sudo service supervisor restart" and again, everything was working fine again.
So:
In both cases, the problem was that the supervisor or the worker got stuck in the same exception even when the real cause was overcome.
In both cases, the solution was to restart the supervisor service.
So why the supervisor got stuck in the first exception and stopped working? or is it the worker?
why does the solutions go away when the restarting the supervisor service?
The text was updated successfully, but these errors were encountered: