[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v5 07/13] job: Do not soft-cancel after a job is done
From: |
Eric Blake |
Subject: |
Re: [PATCH v5 07/13] job: Do not soft-cancel after a job is done |
Date: |
Wed, 6 Oct 2021 16:18:08 -0500 |
User-agent: |
NeoMutt/20210205-815-1dd940 |
On Wed, Oct 06, 2021 at 05:19:34PM +0200, Hanna Reitz wrote:
> The only job that supports a soft cancel mode is the mirror job, and in
> such a case it resets its .cancelled field before it leaves its .run()
> function, so it does not really count as cancelled.
>
> However, it is possible to cancel the job after .run() returns and
> before job_exit() (which is run in the main loop) is executed. Then,
> .cancelled would still be true and the job would count as cancelled.
> This does not seem to be in the interest of the mirror job, so adjust
> job_cancel_async() to not set .cancelled in such a case, and
> job_cancel() to not invoke job_completed_txn_abort().
>
> Signed-off-by: Hanna Reitz <hreitz@redhat.com>
> ---
> job.c | 25 +++++++++++++++++++++----
> 1 file changed, 21 insertions(+), 4 deletions(-)
>
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
- [PATCH v5 00/13] mirror: Handle errors after READY cancel, Hanna Reitz, 2021/10/06
- [PATCH v5 01/13] job: Context changes in job_completed_txn_abort(), Hanna Reitz, 2021/10/06
- [PATCH v5 02/13] mirror: Keep s->synced on error, Hanna Reitz, 2021/10/06
- [PATCH v5 03/13] mirror: Drop s->synced, Hanna Reitz, 2021/10/06
- [PATCH v5 04/13] job: Force-cancel jobs in a failed transaction, Hanna Reitz, 2021/10/06
- [PATCH v5 05/13] job: @force parameter for job_cancel_sync(), Hanna Reitz, 2021/10/06
- [PATCH v5 09/13] mirror: Use job_is_cancelled(), Hanna Reitz, 2021/10/06
- [PATCH v5 07/13] job: Do not soft-cancel after a job is done, Hanna Reitz, 2021/10/06
- [PATCH v5 06/13] jobs: Give Job.force_cancel more meaning, Hanna Reitz, 2021/10/06
- [PATCH v5 08/13] job: Add job_cancel_requested(), Hanna Reitz, 2021/10/06
- [PATCH v5 12/13] mirror: Do not clear .cancelled, Hanna Reitz, 2021/10/06
- [PATCH v5 11/13] mirror: Stop active mirroring after force-cancel, Hanna Reitz, 2021/10/06
- [PATCH v5 13/13] iotests: Add mirror-ready-cancel-error test, Hanna Reitz, 2021/10/06
- [PATCH v5 10/13] mirror: Check job_is_cancelled() earlier, Hanna Reitz, 2021/10/06
- Re: [PATCH v5 00/13] mirror: Handle errors after READY cancel, Vladimir Sementsov-Ogievskiy, 2021/10/07