[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 04/12] job: Force-cancel jobs in a failed transaction
From: |
Vladimir Sementsov-Ogievskiy |
Subject: |
[PULL 04/12] job: Force-cancel jobs in a failed transaction |
Date: |
Tue, 21 Sep 2021 13:20:09 +0300 |
From: Hanna Reitz <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>
Message-Id: <20210907124245.143492-5-hreitz@redhat.com>
Signed-off-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.29.2
- [PULL 00/12] jobs: mirror: Handle errors after READY cancel, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 04/12] job: Force-cancel jobs in a failed transaction,
Vladimir Sementsov-Ogievskiy <=
- [PULL 01/12] job: Context changes in job_completed_txn_abort(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 05/12] job: @force parameter for job_cancel_sync(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 02/12] mirror: Keep s->synced on error, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 06/12] jobs: Give Job.force_cancel more meaning, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 08/12] mirror: Use job_is_cancelled(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 07/12] job: Add job_cancel_requested(), Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 09/12] mirror: Check job_is_cancelled() earlier, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 03/12] mirror: Drop s->synced, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 10/12] mirror: Stop active mirroring after force-cancel, Vladimir Sementsov-Ogievskiy, 2021/09/21
- [PULL 11/12] mirror: Do not clear .cancelled, Vladimir Sementsov-Ogievskiy, 2021/09/21