Skip to content

Commit 1d4a43e

Browse files
XanClicVladimir Sementsov-Ogievskiy
authored and
Vladimir Sementsov-Ogievskiy
committed
job: Force-cancel jobs in a failed transaction
When a transaction is aborted, no result matters, and so all jobs within should be force-cancelled. Signed-off-by: Hanna Reitz <[email protected]> Reviewed-by: Eric Blake <[email protected]> Reviewed-by: Vladimir Sementsov-Ogievskiy <[email protected]> Message-Id: <[email protected]> Signed-off-by: Vladimir Sementsov-Ogievskiy <[email protected]>
1 parent 4471622 commit 1d4a43e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

job.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,12 @@ static void job_completed_txn_abort(Job *job)
766766
if (other_job != job) {
767767
ctx = other_job->aio_context;
768768
aio_context_acquire(ctx);
769-
job_cancel_async(other_job, false);
769+
/*
770+
* This is a transaction: If one job failed, no result will matter.
771+
* Therefore, pass force=true to terminate all other jobs as quickly
772+
* as possible.
773+
*/
774+
job_cancel_async(other_job, true);
770775
aio_context_release(ctx);
771776
}
772777
}

0 commit comments

Comments
 (0)