[13.x] Mark batches allowing failures as finished once all jobs have run
Closed
PA
14d ago+57+57+01234567890123456789-2-2-0123456789
Fixes #61835.
A batch that allows failures runs its finally() callbacks once every job has either succeeded or failed, but finished_at is only set when every job succeeded. So as soon as one job fails, the batch never reports finished(), and queue:prune-batches only removes it through --unfinished.
This sets finished_at at the same point finally() runs, so finally() now receives a finished batch.
Unchanged on purpose:
pending_jobs/failed_jobs, soqueue:retry-batchstill works. A successful retry goes through the normal success path and updatesfinished_atagain.then()still only runs when every job succeeded.BatchFinishedis still only dispatched on full success, so existing listeners don't start firing for failed batches.
The existing test that asserted these batches never finish is updated, and a new one covers a failure followed by a successful last job and a retry.