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
There is a definite change to the behavior of queue:listen between 5.3 and 5.4 that doesn't seem to be listed in the documentation. I am not sure if it is a bug, or an intended change.
Steps To Reproduce:
Create a job that will fail for some reason:
<?php
namespace App\Jobs;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
class BadJob implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
/**
* Create a new job instance.
*
* @return void
*/
public function __construct()
{
//
}
/**
* Execute the job.
*
* @return void
*/
public function handle()
{
\Log::info('Bad Job running');
abort(500);
}
}
Now queue that job somewhere:
\Queue::push(new \App\Jobs\BadJob());
Run the following job on Laravel 5.1, 5.2 or 5.3:
artisan queue:listen --tries=3
I get three "bad job running" in my logs - then the job fails (and queue:failing fires)
If I run that same command on Laravel 5.4 - the logs fill up with bad job running indefinitely (i.e. it never stops). It is ignoring the --tries=X command and never fires the 'queue:failing' event either.
If I add public $tries = 5;
to the BadJob as per the Laravel 5.4 document - then it honors the 5 tries and will stop then. But the documentation says that $tries is optional, and it is not listed as part of the upgrade requirements (i.e. needing to go and add $tries to all the jobs).
As a side note - running queue:work --tries=3 does cause the job to correctly fail in both 5.3 and 5.4.
The text was updated successfully, but these errors were encountered:
Sepix
pushed a commit
to Sepix/framework
that referenced
this issue
Jan 31, 2017
Description:
There is a definite change to the behavior of
queue:listen
between 5.3 and 5.4 that doesn't seem to be listed in the documentation. I am not sure if it is a bug, or an intended change.Steps To Reproduce:
\Queue::push(new \App\Jobs\BadJob());
artisan queue:listen --tries=3
I get three "bad job running" in my logs - then the job fails (and
queue:failing
fires)bad job running
indefinitely (i.e. it never stops). It is ignoring the--tries=X
command and never fires the 'queue:failing' event either.If I add
public $tries = 5;
to the BadJob as per the Laravel 5.4 document - then it honors the 5 tries and will stop then. But the documentation says that
$tries
is optional, and it is not listed as part of the upgrade requirements (i.e. needing to go and add$tries
to all the jobs).As a side note - running
queue:work --tries=3
does cause the job to correctly fail in both 5.3 and 5.4.The text was updated successfully, but these errors were encountered: