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
If a job throws an error (not an exception) it seems to just be reprocessed indefinitely, despite the worker output saying it failed.
In contrast, Laravel queue workers fail the job and don't try to reprocess it. It is then visible in the failed jobs list/table.
The actual error which caused this for us was when trying to process a job whose class had been removed from the codebase (we had checked out a different branch while there were still jobs in the queue), but the effect was that we starting filling the Laravel log file at an alarming rate.
Steps To Reproduce
Create a new job:
<?phpnamespaceApp\Jobs;
useIlluminate\Bus\Queueable;
useIlluminate\Contracts\Queue\ShouldQueue;
useIlluminate\Foundation\Bus\Dispatchable;
class ErrorJob implements ShouldQueue
{
use Dispatchable;
use Queueable;
publicfunctionhandle(): void
{
trigger_error('Error triggered in job');
}
}
Create a command to dispatch it (for convenience):
<?phpnamespaceApp\Console\Commands;
useApp\Jobs\ErrorJob;
useIlluminate\Console\Command;
class QueueDummyJobs extends Command
{
protected$signature = 'app:queue-error-job';
publicfunctionhandle(): int
{
ErrorJob::dispatch();
$this->getOutput()->writeln('Job dispatched');
returnself::SUCCESS;
}
}
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.
If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.
Horizon Version
5.29.4
Laravel Version
11.34.2
PHP Version
8.3.14
Redis Driver
PhpRedis
Redis Version
6.1.0
Database Driver & Version
mysqlnd 8.3.14
Description
If a job throws an error (not an exception) it seems to just be reprocessed indefinitely, despite the worker output saying it failed.
In contrast, Laravel queue workers fail the job and don't try to reprocess it. It is then visible in the failed jobs list/table.
The actual error which caused this for us was when trying to process a job whose class had been removed from the codebase (we had checked out a different branch while there were still jobs in the queue), but the effect was that we starting filling the Laravel log file at an alarming rate.
Steps To Reproduce
Create a new job:
Create a command to dispatch it (for convenience):
Dispatch that job:
Run the worker:
The text was updated successfully, but these errors were encountered: