From patchwork Sat Nov 20 05:09:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Morris X-Patchwork-Id: 1985 Return-Path: Delivered-To: patchwork@archlinux.org Received: from mail.archlinux.org [2a01:4f9:c010:3052::1] by patchwork.archlinux.org with IMAP (fetchmail-6.4.23) for (single-drop); Sat, 20 Nov 2021 05:10:04 +0000 (UTC) Received: from mail.archlinux.org by mail.archlinux.org with LMTP id oEuIOyuDmGGsMggAK+/4rw (envelope-from ) for ; Sat, 20 Nov 2021 05:10:03 +0000 Received: from lists.archlinux.org (lists.archlinux.org [IPv6:2a01:4f9:c010:9eb4::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.archlinux.org (Postfix) with ESMTPS id 68003A9DEFE; Sat, 20 Nov 2021 05:10:02 +0000 (UTC) Received: from lists.archlinux.org (localhost [IPv6:::1]) by lists.archlinux.org (Postfix) with ESMTP id 2F39C9CDF12; Sat, 20 Nov 2021 05:10:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-rsa; t=1637385002; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qSiVXAEDuaf52BiHA4hxtSWLO1sZz9Ih3RSQN97NGQ8=; b=Iek702+NOdT3NsVlH74ymp98SwIZoTlYSflqKLKBIahiKmORuBVpiNWLu3hfJ5MZQefh7x EDe9XyzSsACVxp3X39UrEhJ+Z7ztFyfFKj29/f+blex6877kJZgVhDUAKJDnCn71HCb+g2 +Iq+Fv6o6mLVncRJZI3l6Gfbl8G/J1UIFivzTuGbezz6kvUJtznEzTePT/UG1vHp3xCfnr vbaGATwRU2NVluijJ1N+YHOO4sfu4WMkKzKF/rtVgLQQuliRSAGyOaFBuXFKRvs3HR+q6B Haq4dyz2AXLE0/MRBqSNa/3L+A3fifLCn6k0/4kaQq9Q6UvF1u5bxS+Ae/4nCXIecw0U8i KlExP3YiWVab+S2zDBhBCGe9P8UKCw3FxsDUl4dKtQrswxq/sHJfBJGw7VP+04mPtRZ3IZ PrvIAE90D6hHIqNHAAVb71QMHE+Z5029JsLz8nqdJ3cv1au2Srm/2Z9k0kk9nzPt5p44Zv 4D/LNge0n38NJ+ab98mAriZW2ONUMRthFLjjBltp69kxUBPvqu1MUymITqzcceFKgBY8iN nayMi+fU4644vxt+dShPooKU4awfdsVfaraD2Cl0n1fVj6dD228BZX2seBN5udwqveUBdN 2o7d12/71rQEGb/qtC8iKOA41Unu3HHNThBvdXfQGfkHFmBxm2IX8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=lists.archlinux.org; s=dkim-ed25519; t=1637385002; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=qSiVXAEDuaf52BiHA4hxtSWLO1sZz9Ih3RSQN97NGQ8=; b=KTPVg9w+85V9h1G2nhTQst+H/s5QzuMRQ5cTYKwpc3WUe+TcezBpV+dlpcWuOS97sU4Nih ccHB/FDVd9+Ib6AQ== X-Original-To: pacman-dev@lists.archlinux.org Delivered-To: pacman-dev@lists.archlinux.org Received: from mail.0cost.org (mail.0cost.org [45.79.226.90]) by lists.archlinux.org (Postfix) with ESMTPS id 1EF709CDF08 for ; Sat, 20 Nov 2021 05:10:00 +0000 (UTC) Received: by mail.0cost.org (Postfix, from userid 1001) id D5D8D5FF55; Sat, 20 Nov 2021 05:09:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mail X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.4 Received: from volcano.local.net (unknown [IPv6:2001:470:1f05:597:2e4d:54ff:fed5:b29c]) by mail.0cost.org (Postfix) with ESMTPSA id DD4585FF1F; Sat, 20 Nov 2021 05:09:55 +0000 (UTC) To: pacman-dev@lists.archlinux.org Cc: Kevin Morris Subject: [PATCH] fix: release transaction lock before unregistering syncdbs Date: Fri, 19 Nov 2021 21:09:40 -0800 Message-Id: <20211120050939.53411-1-kevr@0cost.org> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 X-BeenThere: pacman-dev@lists.archlinux.org X-Mailman-Version: 2.1.35 Precedence: list List-Id: Discussion list for pacman development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Kevin Morris via pacman-dev From: Kevin Morris Reply-To: Kevin Morris Errors-To: pacman-dev-bounces@lists.archlinux.org Sender: "pacman-dev" Authentication-Results: mail.archlinux.org; dkim=pass header.d=lists.archlinux.org header.s=dkim-rsa header.b=Iek702+N; dkim=pass header.d=lists.archlinux.org header.s=dkim-ed25519 header.b=KTPVg9w+; dmarc=pass (policy=none) header.from=archlinux.org; spf=pass (mail.archlinux.org: domain of pacman-dev-bounces@lists.archlinux.org designates 2a01:4f9:c010:9eb4::1 as permitted sender) smtp.mailfrom=pacman-dev-bounces@lists.archlinux.org X-Rspamd-Queue-Id: 68003A9DEFE X-Spamd-Result: default: False [-3.41 / 15.00]; DWL_DNSWL_MED(-2.00)[archlinux.org:dkim]; DMARC_POLICY_ALLOW(-0.50)[archlinux.org,none]; R_MISSING_CHARSET(0.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:4f9:c010:9eb4::1]; RCVD_IN_DNSWL_MED(-0.20)[2a01:4f9:c010:9eb4::1:from]; R_DKIM_ALLOW(-0.20)[lists.archlinux.org:s=dkim-rsa,lists.archlinux.org:s=dkim-ed25519]; MAILLIST(-0.20)[mailman]; MIME_GOOD(-0.10)[text/plain]; HAS_LIST_UNSUB(-0.01)[]; FROM_HAS_DN(0.00)[]; RCVD_COUNT_FIVE(0.00)[5]; HAS_REPLYTO(0.00)[kevr@0cost.org]; PREVIOUSLY_DELIVERED(0.00)[pacman-dev@lists.archlinux.org]; REPLYTO_DOM_NEQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:24940, ipnet:2a01:4f9::/32, country:DE]; DKIM_TRACE(0.00)[lists.archlinux.org:+]; TO_DN_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_NEQ_ENVFROM(0.00)[pacman-dev@lists.archlinux.org,pacman-dev-bounces@lists.archlinux.org]; RCPT_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; NEURAL_HAM(-0.00)[-1.000]; FORGED_SENDER_MAILLIST(0.00)[] X-Rspamd-Server: mail.archlinux.org Signed-off-by: Kevin Morris --- `alpm_unregister_all_syncdbs` errors out when a transaction is held. Since this function closes transactions as-is, moving this call below the transaction unlock step solves issues that `pyalpm` sees when it cleans up the handle. lib/libalpm/alpm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 6708e202..1c38feb8 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -107,10 +107,6 @@ int SYMEXPORT alpm_release(alpm_handle_t *myhandle) myhandle->db_local = NULL; } - if(alpm_unregister_all_syncdbs(myhandle) == -1) { - ret = -1; - } - #ifdef HAVE_LIBCURL curl_multi_cleanup(myhandle->curlm); curl_global_cleanup(); @@ -118,6 +114,11 @@ int SYMEXPORT alpm_release(alpm_handle_t *myhandle) #endif _alpm_handle_unlock(myhandle); + + if(alpm_unregister_all_syncdbs(myhandle) == -1) { + ret = -1; + } + _alpm_handle_free(myhandle); return ret;