When running php artisan queue: work --tries = 3, from the third job next to the error, because with each job run the mongo queue increments +1 in all jobs doing causing errors due to attempts (information incorrect). In my tests I had to run the jobs without the --tries parameter.
this bug causes MaxAttemptsExceededException to all jobs
Actually what he means is:
When running a job, if the job fails, the entire jobs collection is affected, all the entries "_attempts_" are incremented, and when you try to run the next job, if you failed the previous with more than you --tries parameter, it fails throwing a MaxAttempsExceededExcepetion.
I also encountered this issue.
@jenssegers why isn't this pull request merged?
@judhizputra This is not a PR. Can't find a PR by @NoelDeMartin
@jenssegers the fix is released in any version? For microservice based only on Mongo is a seriously problem this bug.
Thanks in advance.
I solved my problem using Beanstalk Queues
fixed?
I am suffering the same issue, which occurs during the search for the next executable job.
Everytime a previous job is done, the attempts of all waiting jobs are increased by this query:
jobs.UpdateMany({"_id":(jobId)},{"$set":{"reserved":0,"reserved_at":null,"attempts":4}},{"multiple":true})
After handling 3 waiting jobs, all further jobs are deleted and moved to failed_jobs.
Most helpful comment
I am suffering the same issue, which occurs during the search for the next executable job.
Everytime a previous job is done, the attempts of all waiting jobs are increased by this query:
jobs.UpdateMany({"_id":(jobId)},{"$set":{"reserved":0,"reserved_at":null,"attempts":4}},{"multiple":true})
After handling 3 waiting jobs, all further jobs are deleted and moved to failed_jobs.