qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Hanna Reitz <hreitz@redhat.com>
To: qemu-block@nongnu.org
Cc: Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org
Subject: [PATCH v5 04/13] job: Force-cancel jobs in a failed transaction
Date: Wed,  6 Oct 2021 17:19:31 +0200	[thread overview]
Message-ID: <20211006151940.214590-5-hreitz@redhat.com> (raw)
In-Reply-To: <20211006151940.214590-1-hreitz@redhat.com>

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>
---
 job.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

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);
         }
     }
-- 
2.31.1



  parent reply	other threads:[~2021-10-06 15:28 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-06 15:19 [PATCH v5 00/13] mirror: Handle errors after READY cancel Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 01/13] job: Context changes in job_completed_txn_abort() Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 02/13] mirror: Keep s->synced on error Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 03/13] mirror: Drop s->synced Hanna Reitz
2021-10-06 15:19 ` Hanna Reitz [this message]
2021-10-06 15:19 ` [PATCH v5 05/13] job: @force parameter for job_cancel_sync() Hanna Reitz
2021-10-06 15:28   ` Eric Blake
2021-10-07  8:19   ` Vladimir Sementsov-Ogievskiy
2021-10-06 15:19 ` [PATCH v5 06/13] jobs: Give Job.force_cancel more meaning Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 07/13] job: Do not soft-cancel after a job is done Hanna Reitz
2021-10-06 21:18   ` Eric Blake
2021-10-07  8:31   ` Vladimir Sementsov-Ogievskiy
2021-10-06 15:19 ` [PATCH v5 08/13] job: Add job_cancel_requested() Hanna Reitz
2021-10-06 21:24   ` Eric Blake
2021-10-07  8:33   ` Vladimir Sementsov-Ogievskiy
2021-10-06 15:19 ` [PATCH v5 09/13] mirror: Use job_is_cancelled() Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 10/13] mirror: Check job_is_cancelled() earlier Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 11/13] mirror: Stop active mirroring after force-cancel Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 12/13] mirror: Do not clear .cancelled Hanna Reitz
2021-10-06 15:19 ` [PATCH v5 13/13] iotests: Add mirror-ready-cancel-error test Hanna Reitz
2021-10-07  8:39 ` [PATCH v5 00/13] mirror: Handle errors after READY cancel Vladimir Sementsov-Ogievskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211006151940.214590-5-hreitz@redhat.com \
    --to=hreitz@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=vsementsov@virtuozzo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).