From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id +CYdHhOh2WUDdAAA62LTzQ:P1 (envelope-from ) for ; Sat, 24 Feb 2024 08:56:03 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id +CYdHhOh2WUDdAAA62LTzQ (envelope-from ) for ; Sat, 24 Feb 2024 08:56:03 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers eddsa verify failed") header.d=russelstein.xyz header.s=ed25519 header.b=HU1nfFPX; dkim=fail ("headers rsa verify failed") header.d=russelstein.xyz header.s=rsa header.b=ArwPEP3r; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1708761363; 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-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=CmytX9wqOyo2TWgoT+8SJ9s2vpQlHSJnqSNuwNL8Y/0=; b=BpEgUzjupbMdOSP3Cqc/+jOuliW83uzK6wVGjXkSAwqGkxMlPCVQcYLwocKjgLHkI1U4O0 C/Vv/DioBPZZIdfeNadciYB4Rd/ztq+Hh6OiH1IEFWxOEUBLGBhlKybxqtOOHOSVTEa7Tz qJwV9EVIO1Jgu2Pxa4JkY9d18C/eN1myy2xdrPFMVSNRqcxpU8X9fm2037HPLDQCP1HeI0 vJaQarQzEa+DJnBsyEiA+ai1JE733EFf+t5g8P84x9lvKnKBg+0PSxylP5uHC/R1wfWaN+ QZngyFLrAV67DBUUY+ZAI5ynYP9MiXZamYek/WsK5sC49BQBT7QVYtoMEb3vGQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers eddsa verify failed") header.d=russelstein.xyz header.s=ed25519 header.b=HU1nfFPX; dkim=fail ("headers rsa verify failed") header.d=russelstein.xyz header.s=rsa header.b=ArwPEP3r; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1708761363; a=rsa-sha256; cv=none; b=ZweakhPz3lZ09TT3C1jf619c4OqMhvSwfqGVLphrAga0ZmVavl+ZPiPC13s84mRQZ8YTvM 8+QExHvP79A2/oxHXI0T+eHAgif4KIwK9aS1MdxMmdsL4+11EwKvSfwVmrqtFP8pNPctf8 QYef8ZHgvChbxn9W6na33FKbfF8D/xwyMIg1DsdRwjVJ0RiJyfZOtwwVD6t+SbCki6Ti+N rQKz3zPM+v6ISrlUVWWk0lNM1AAjnkF/XaSOjqNxuaHCZ4Yv9XChruUPqklzRpbOqJALcv U7c44sIyHPyi1eItcW1dT4BxIfNN+WxXVM1NdCnjU8i/jFHxOfWmEkvpwBOjDg== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 593BF43B4D for ; Sat, 24 Feb 2024 08:56:01 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rdmso-0006OL-6J; Sat, 24 Feb 2024 02:55:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rdmsl-0006Np-IM for guix-patches@gnu.org; Sat, 24 Feb 2024 02:55:40 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rdmsl-00014o-2h for guix-patches@gnu.org; Sat, 24 Feb 2024 02:55:39 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rdmt8-00053G-VW for guix-patches@gnu.org; Sat, 24 Feb 2024 02:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69292] [PATCH 2/6] store: database: Remove with-statement and associated code. Resent-From: Reepca Russelstein Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 24 Feb 2024 07:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69292 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , Tobias Geerinckx-Rice , Simon Tournier , Mathieu Othacehe , Christopher Baines , Ricardo Wurmus , 69292@debbugs.gnu.org, Christopher Baines Received: via spool by 69292-submit@debbugs.gnu.org id=B69292.170876130319220 (code B ref 69292); Sat, 24 Feb 2024 07:56:02 +0000 Received: (at 69292) by debbugs.gnu.org; 24 Feb 2024 07:55:03 +0000 Received: from localhost ([127.0.0.1]:35628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdms9-0004zX-GL for submit@debbugs.gnu.org; Sat, 24 Feb 2024 02:55:03 -0500 Received: from mailout.russelstein.xyz ([209.141.47.21]:60706) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rdaRt-0004om-P1 for 69292@debbugs.gnu.org; Fri, 23 Feb 2024 13:39:10 -0500 DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=russelstein.xyz; s=ed25519; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CmytX9wqOyo2TWgoT+8SJ9s2vpQlHSJnqSNuwNL8Y/0=; b=HU1nfFPXiw1jobWaOnwBFg9ITZ aydvMclMeyaJm3fWTfQCZp9PH88saqaXvyYb8BBsoZZ0qxwBtBXaC5cgUfCQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=russelstein.xyz; s=rsa; h=Content-Type:MIME-Version:Message-ID:Date: References:In-Reply-To:Subject:Cc:To:From:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=CmytX9wqOyo2TWgoT+8SJ9s2vpQlHSJnqSNuwNL8Y/0=; b=ArwPEP3rBF0ONcGJVtyaTrvcrS XNzQXMyOp3TZWIvEAB58aq3qBcwL1APSSDbxEWJhF9SJmxvBdvvM5HitKBiyr2v7xzElUww4AzqVb dBfiZmY6MMRq+o23rvWQKWjyeRUpK3C/lccMNcK7xYrkvNPB93sLm7qHTBB2YHRmiaRPPTs5WEfZ2 StcgCSp/DCaImMhH2fvZKJvWYB2wSbqA7MTwAnHSPz6efM5HyHgWzwY0TBHsoGJSowpHMHr6om46p PqqzrkkafrRE4efHrh6Z/ZGxBOkP+mKPYgOTGQJaO7ueIjl3qxIQ4xDaATqQtMa10kcv8sNLEgEN6 jEgMXnq+Mg4KpklLIxWEQ3SFggoe+J7hHn5BLxM25xLQp2lw2UQ1WRTYLBzEZWFAHZUeiH85Quz+l akfnMdYxgRaRLFq82+8ItMVWuYnVM/LopH+T0ILwne4cMiLmp0eoNxj4O/lwtDrPNrsUnRegli4qL CGxLz5SlFYQ12bq22CiyQOjW2G016lNb14JGXOLHtVkQLsQDeWtagfPZom2NTYX701COdflPN+NAQ 42vx2jzHAR7YQUefzhk+So++QKFmfJAMGfSDXRVEDnhIWaRNQhlALLLQEGNyYDG8Tcy6MbouaACYy fVmr+3b+++niZ4/V3FVci00RDofrFt3nnZZdWwBLY=; Received: by russelstein.xyz with esmtpsa (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96.1) (envelope-from ) id 1rdaPD-000000005bA-2zDk; Fri, 23 Feb 2024 12:36:24 -0600 In-Reply-To: <878r3bf8aw.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Fri, 23 Feb 2024 17:35:03 +0100") References: <4b6a268daab5e0b307dff2229d551a47c9fe1ebc.1708457946.git.mail@cbaines.net> <878r3bf8aw.fsf@gnu.org> Date: Fri, 23 Feb 2024 12:32:03 -0600 Message-ID: <87ttlzqbfg.fsf@russelstein.xyz> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Mailman-Approved-At: Sat, 24 Feb 2024 02:55:00 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Reepca Russelstein X-ACL-Warn: , Reepca Russelstein via Guix-patches From: Reepca Russelstein via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -7.37 X-Spam-Score: -7.37 X-Migadu-Queue-Id: 593BF43B4D X-Migadu-Scanner: mx11.migadu.com X-TUID: MKRHhPNL+JNF --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable >> I think using dynamic-wind to finalize all statements is the wrong >> approach. Firstly it would be good to allow reseting statements rather t= han >> finalizing them. Let me once again mention https://issues.guix.gnu.org/69292#7 with this much more magnificent Cc list. >> Then for the problem of handling errors, the approach I've >> settled on in the build coordinator is to close the database connection,= since >> that'll trigger guile-sqlite3 to finalize all the cached statements. And in the event that a statement is *not* cached, it will hang around until the gc next pumps the statement guardian, at which point it will do... whatever happens when a statement is finalized after the database connection it was created with has already been closed, I guess. I don't know if that's a problem or not. On further investigation, it appears that sqlite_close would return SQLITE_BUSY, but guile-sqlite3's sqlite-close doesn't throw any exceptions, and according to https://www.sqlite.org/c3ref/close.html it would just hold off on actually closing the database until all statements have been finalized. So I guess that works. >> >> This reverts commit 5d6e2255286e591def122ec2f4a3cbda497fea21. >> >> * .dir-locals.el (scheme-mode): Remove with-statement. >> * guix/store/database.scm (call-with-statement): Remove procedure. >> (with-statement): Remove syntax rule. >> (call-with-transaction, last-insert-row-id, path-id, update-or-insert, >> add-references): Don't use with-statement. >> >> Change-Id: I2fd976b3f12ec8105cc56350933a953cf53647e8 > > I=E2=80=99m all for removing =E2=80=98dynamic-wind=E2=80=99, we=E2=80=99l= l have to do it to make it > usable in a fiberized context anyway. > > I=E2=80=99ll let reepca comment. What is the proper fibers-friendly replacement for dynamic-wind, anyway, that is "like dynamic-wind, except when suspending a fiber"? It feels like the current interaction between dynamic-wind and fibers is more of an accident of how the implementation works; I don't suppose fibers could export a transparent replacement, like how it already exports a replacement for 'sleep'? Or perhaps the underlying issue is that we keep using 'dynamic-wind' in situations where it only makes sense to enter or exit the dynamic extent once? Is it time to bring 'unwind-protect' back into style? I see that fibers now has a dynamic-wind*, should that be preferred? I don't have a strong opinion on these changes, I just want to make sure we're all aware of how guile-sqlite3's sqlite-finalize acts with cached statements. =2D reepca --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQFLBAEBCAA1FiEEdNapMPRLm4SepVYGwWaqSV9/GJwFAmXY5KMXHHJlZXBjYUBy dXNzZWxzdGVpbi54eXoACgkQwWaqSV9/GJwZ5gf9G5/VPsqO4Y/RkSuL6Qz2RdNy kLNh3TiARpSTcEh5I3KB9pPyztQu5w0QYwp91VrdQbLOtzUXwzgQQlRgmhrtruwH cOwOgYqHZOjyJwMRz0QQLs0rzNr5rsfNFVDBjLViBg3nZ5InRXJ7xWZo6s9thsoz exmMvTVuDRlDaA9PNTU1N/GKaLkq/LTgpw4mQ/PCrGLd/noNHGfyLoIbhyi9w1ok Iew6wYUbioBwGlj6/rLz6hPqt7irSKtZ/WpuWH+CaA7bhH+t0GQ18FTEWvErf9zW xkCjNYuodAXlEzbqoExWkAvRPayQ0c3+xy+YAbs3vqC0SHFMPWMa/x+/PG1e4A== =LhLQ -----END PGP SIGNATURE----- --=-=-=--