Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Bus::batch jobs are lost and finally is not called #39562

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

Closed
avivais opened this issue Nov 10, 2021 · 0 comments
Closed

Bus::batch jobs are lost and finally is not called #39562

avivais opened this issue Nov 10, 2021 · 0 comments

Comments

@avivais
Copy link

avivais commented Nov 10, 2021

Related to #39243

We have a repeating batch job, but results seem to be sporadic:

  • We dispatch X jobs
  • All X move to pending
  • All X start processing (I see relevant logs)
  • In some cases, all X are reported as Failed (As they should, in this case, a 404 responses), and finally callback gets called
  • In some cases X-1 are reported as failed, 1 seems to be "lost", finally callback is not called
Bus::batch($jobs)
  ->onQueue('queue_name')
  ->name(Job::class)
  ->allowFailures()
  ->catch(function () {
    logger()->error("Job failed");
  })
  ->finally(function () use ($feed) {
    logger("Jobs done);
  })
  ->dispatch();

Looking at failed_jobs table in DB, I do see all X jobs with failed_at and exception populated

Am I missing something?
Is there anything that can be done in such cases to ensure all jobs are processed and finally gets called?

@laravel laravel locked and limited conversation to collaborators Nov 10, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants