summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorHanna Reitz <hreitz@redhat.com>2021-10-06 17:19:31 +0200
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>2021-10-07 10:40:48 +0200
commit1d4a43e9464f8945bd8aa2ed9d95f184b011befe (patch)
tree2c19c140dfe2d4419349846a5c7e8154678fc5c4
parent447162242803bdc38bb198312e1d0a0675948424 (diff)
downloadfocaccia-qemu-1d4a43e9464f8945bd8aa2ed9d95f184b011befe.tar.gz
focaccia-qemu-1d4a43e9464f8945bd8aa2ed9d95f184b011befe.zip
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 <hreitz@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Message-Id: <20211006151940.214590-5-hreitz@redhat.com>
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
-rw-r--r--job.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/job.c b/job.c
index 810e6a2065..e74d81928d 100644
--- a/job.c
+++ b/job.c
@@ -766,7 +766,12 @@ static void job_completed_txn_abort(Job *job)
         if (other_job != job) {
             ctx = other_job->aio_context;
             aio_context_acquire(ctx);
-            job_cancel_async(other_job, false);
+            /*
+             * This is a transaction: If one job failed, no result will matter.
+             * Therefore, pass force=true to terminate all other jobs as quickly
+             * as possible.
+             */
+            job_cancel_async(other_job, true);
             aio_context_release(ctx);
         }
     }