From 5273510e9f228a300ec6207d4502f1c6253aed5e Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Tue, 24 Apr 2012 11:21:03 +0200 Subject: transaction: cancel jobs non-recursively on isolate Recursive cancellation of jobs would trigger OnFailure actions of dependent jobs. This is not desirable when isolating. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=798328 --- src/core/transaction.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'src/core/transaction.c') diff --git a/src/core/transaction.c b/src/core/transaction.c index 8b4116806b..aee155f519 100644 --- a/src/core/transaction.c +++ b/src/core/transaction.c @@ -546,18 +546,16 @@ static int transaction_apply(Transaction *tr, Manager *m, JobMode mode) { /* When isolating first kill all installed jobs which * aren't part of the new transaction */ - rescan: HASHMAP_FOREACH(j, m->jobs, i) { assert(j->installed); if (hashmap_get(tr->jobs, j->unit)) continue; - /* 'j' itself is safe to remove, but if other jobs - are invalidated recursively, our iterator may become - invalid and we need to start over. */ - if (job_finish_and_invalidate(j, JOB_CANCELED) > 0) - goto rescan; + /* Not invalidating recursively. Avoids triggering + * OnFailure= actions of dependent jobs. Also avoids + * invalidating our iterator. */ + job_finish_and_invalidate(j, JOB_CANCELED, false); } } -- cgit v1.2.3-54-g00ecf