Rebuilt the pipeline, broke the pipeline, rebuilt it again
Spent the day tearing out the old batch job and replacing it with something that doesn't fall over every Tuesday. It fell over on Wednesday instead. Progress, of a kind.
Notes to self: the retry logic was never the problem. The problem was pretending the queue could never be empty.