[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH for-6.2 v3 04/12] job: Force-cancel jobs in a failed transact
From: |
Eric Blake |
Subject: |
Re: [PATCH for-6.2 v3 04/12] job: Force-cancel jobs in a failed transaction |
Date: |
Fri, 6 Aug 2021 14:22:18 -0500 |
User-agent: |
NeoMutt/20210205-687-0ed190 |
On Fri, Aug 06, 2021 at 11:38:51AM +0200, Max Reitz wrote:
> When a transaction is aborted, no result matters, and so all jobs within
> should be force-cancelled.
>
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
> job.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
Reviewed-by: Eric Blake <eblake@redhat.com>
>
> diff --git a/job.c b/job.c
> index 3fe23bb77e..24e7c4fcb7 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
>
>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH for-6.2 v3 00/12] mirror: Handle errors after READY cancel, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 01/12] job: Context changes in job_completed_txn_abort(), Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 02/12] mirror: Keep s->synced on error, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 03/12] mirror: Drop s->synced, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 04/12] job: Force-cancel jobs in a failed transaction, Max Reitz, 2021/08/06
- Re: [PATCH for-6.2 v3 04/12] job: Force-cancel jobs in a failed transaction,
Eric Blake <=
- [PATCH for-6.2 v3 05/12] job: @force parameter for job_cancel_sync{, _all}(), Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 06/12] jobs: Give Job.force_cancel more meaning, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 08/12] mirror: Use job_is_cancelled(), Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 09/12] mirror: Check job_is_cancelled() earlier, Max Reitz, 2021/08/06
- [PATCH for-6.2 v3 07/12] job: Add job_cancel_requested(), Max Reitz, 2021/08/06