]> git.proxmox.com Git - mirror_qemu.git/commitdiff
job: Force-cancel jobs in a failed transaction
authorHanna Reitz <hreitz@redhat.com>
Wed, 6 Oct 2021 15:19:31 +0000 (17:19 +0200)
committerVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Thu, 7 Oct 2021 08:40:48 +0000 (10:40 +0200)
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>
job.c

diff --git a/job.c b/job.c
index 810e6a2065b7b13a96c1bcbce5425c8cbd8e6d62..e74d81928dcf4e48daaeef6ffb67509eb0b6ea70 100644 (file)
--- 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);
         }
     }