Laravel batch jobs stuck in horizon
05:03 01 Dec 2021

I'm having some trouble with batch jobs and Horizon, I created a simple job as proof of concept that only performs a sleep(3) operation.

Then using the relatively new feature of Laravel Queue Batches I created 1 thousand jobs:

$jobs = [];
for($i = 0; $i < 1000; $i++) {
    $jobs[] = new JustSleepJob();
}

Bus::batch($jobs)
    ->name('Jobs Test')
    ->dispatch();

For some reason Horizon is reporting that only 33% of that batch has been processed and I don't know why nor how to remove that stuck entry from horizon. stuck job in horizon screenshot

Has anyone experienced something similar?

Further info with versions on this issue that was closed almost immediately: https://github.com/laravel/horizon/issues/1098

php laravel laravel-horizon