title: Laravel last batch job stays in pending
body: <p>Description:
  I have several servers on which job is performing search to receive results. When I add new server to database I need to perform search for each existing user. Every search is a single job. I decided to use Laravel's batch to group these jobs. Code looks like this:</p>
  <pre><code>function serverAdded() {
    $batch = Bus::batch([])
      -&gt;allowFailures()
      -&gt;catch(function() { ... })
      -&gt;then(function() { ... })
      -&gt;dispatch();
  
      $users = User::lazy();
  
      foreach ($users as $user) {
        $batch-&gt;add(new SeearchJob($user));
      }
   }
  </code></pre>
  <p>Problem:
  The problem is that sometimes 1 job (always the last one) stays in pending state as shown in the attached picture. In logs from job I can see that job is executed correctly. If searching goes wrong I mark job as failed and retrying all failed jobs, but this job is neither finished or failed...</p>
  <p>Any ideas?</p>
  <p><a href="https://i.stack.imgur.com/9HrnM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9HrnM.png" alt="Pending batch job" /></a></p>