From 591f8a68b188e7e9239532e93ed452768589e281 Mon Sep 17 00:00:00 2001 From: Joaquim Rocha Date: Mon, 12 Mar 2018 13:24:22 +0100 Subject: [PATCH] pull: Ignore the cancellable when aborting a transaction In ostree_repo_abort_transaction, if we pass a cancellable and it gets canceled, then the function may fail to fully clean up the transaction state. This was happening e.g. when the ostree_repo_pull_with_options call got cancelled. To fix this, as suggested by Colin Walters, we set the passed cancellable as NULL, in order for it to be ignored. https://github.com/ostreedev/ostree/issues/1491 Closes: #1492 Approved by: jlebon --- src/libostree/ostree-repo-commit.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 875743b4..16081a95 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -2153,6 +2153,12 @@ ostree_repo_abort_transaction (OstreeRepo *self, GCancellable *cancellable, GError **error) { + /* Always ignore the cancellable to avoid the chance that, if it gets + * canceled, the transaction may not be fully cleaned up. + * See https://github.com/ostreedev/ostree/issues/1491 . + */ + cancellable = NULL; + /* Note early return */ if (!self->in_transaction) return TRUE;