From 02972b2b9a30f17640d3e4f97b9a1c09cddbdb05 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Tue, 12 Dec 2017 13:01:48 -0500 Subject: [PATCH] txn: Let first error win vs cancellation Basically since we're doing internal async ops which set the cancellable on failure, we still want the first error to win since it'll be more useful. See the docs for `g_task_set_check_cancellable()` for more. --- src/daemon/rpmostreed-transaction.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/daemon/rpmostreed-transaction.c b/src/daemon/rpmostreed-transaction.c index 686b56f08b..3e4c490074 100644 --- a/src/daemon/rpmostreed-transaction.c +++ b/src/daemon/rpmostreed-transaction.c @@ -590,6 +590,10 @@ transaction_handle_start (RPMOSTreeTransaction *transaction, priv->cancellable, transaction_execute_done_cb, NULL); + /* Some of the async ops in rpmostree-core.c will cancel, + * but we want the first error to take precedence. + */ + g_task_set_check_cancellable (task, FALSE); g_task_run_in_thread (task, transaction_execute_thread); g_object_unref (task); }