pub fn mark_done_batch(
backend: &mut Backend,
reports: &[TaskReport],
) -> Result<(), String>Expand description
Persists a batch of finished reports to the Task store, with bounded retry on a transient DB
failure. The finalize thread drains the batch off the bounded done channel and hands it here in
one mark_done call (amortizing the round-trip). On exhausted retries it returns Err, which
the finalize thread propagates into a panic → the manager aborts the whole dispatcher — the
intended fail-fast on a DB runaway (the channel design replaces the old mutex-poisoning that
achieved the same propagation). A crash here loses nothing: the tasks remain Queued and
recover on restart.