From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id aBWAIAOh6F/qDwAA0tVLHw (envelope-from ) for ; Sun, 27 Dec 2020 14:58:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id MGJqHAOh6F/WPQAA1q6Kng (envelope-from ) for ; Sun, 27 Dec 2020 14:58:11 +0000 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 BEC8C940355 for ; Sun, 27 Dec 2020 14:58:10 +0000 (UTC) Received: from localhost ([::1]:44576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktXUn-0000Xa-LM for larch@yhetil.org; Sun, 27 Dec 2020 09:58:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:57692) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktXUg-0000Vd-Aa for guix-patches@gnu.org; Sun, 27 Dec 2020 09:58:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:49915) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktXUg-0001Ns-2V for guix-patches@gnu.org; Sun, 27 Dec 2020 09:58:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktXUg-00034q-0s for guix-patches@gnu.org; Sun, 27 Dec 2020 09:58:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#45323] [PATCH] substitute: Reuse connections for '--query'. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 27 Dec 2020 14:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45323 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Christopher Baines Received: via spool by 45323-submit@debbugs.gnu.org id=B45323.160908107311812 (code B ref 45323); Sun, 27 Dec 2020 14:58:01 +0000 Received: (at 45323) by debbugs.gnu.org; 27 Dec 2020 14:57:53 +0000 Received: from localhost ([127.0.0.1]:33228 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktXUX-00034R-A8 for submit@debbugs.gnu.org; Sun, 27 Dec 2020 09:57:53 -0500 Received: from eggs.gnu.org ([209.51.188.92]:36286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktXUV-00034E-RW for 45323@debbugs.gnu.org; Sun, 27 Dec 2020 09:57:52 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50018) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktXUQ-0001Lv-EI; Sun, 27 Dec 2020 09:57:46 -0500 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=51538 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ktXUO-000739-7E; Sun, 27 Dec 2020 09:57:45 -0500 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20201219144952.2725-1-ludo@gnu.org> <87o8ikwoih.fsf@gnu.org> <871rffbgzk.fsf@cbaines.net> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 =?UTF-8?Q?Niv=C3=B4se?= an 229 de la =?UTF-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Sun, 27 Dec 2020 15:57:42 +0100 In-Reply-To: <871rffbgzk.fsf@cbaines.net> (Christopher Baines's message of "Thu, 24 Dec 2020 11:06:39 +0000") Message-ID: <87tus7thy1.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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: , Cc: 45323@debbugs.gnu.org Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -2.82 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: BEC8C940355 X-Spam-Score: -2.82 X-Migadu-Scanner: scn0.migadu.com X-TUID: je9qpz6g9/3V --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi! Christopher Baines skribis: > The Guix Build Coordinator uses code from this script, and I'm sometimes > seeing exceptions like [1] when running with these changes. This is when > calling lookup-narinfos. > > 1: > #<&compound-exception components: (#<&error> #<&irritants irritants: (# reason.> write_to_session_record_port)> #<&exception-with-kind-and-args k= ind: gnutls-error args: (# write_to_session_record_port)>)>, > > When this happens, things seem to get stuck and retrying calling > lookup-narinfos leads to the same exception. I'm guessing this might be > happening because the broken connection is being cached and reused. Ah, that looks like another thing that might break. Does the patch below help? Thanks for reporting it, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 8084c89ae5..e53de8c304 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -43,6 +43,7 @@ (open-connection-for-uri . guix:open-connection-for-uri) store-path-abbreviation byte-count->string)) + #:autoload (gnutls) (error/invalid-session) #:use-module (guix progress) #:use-module ((guix build syscalls) #:select (set-thread-name)) @@ -1054,9 +1055,12 @@ server certificates." ;; If PORT was cached and the server closed the connection in the ;; meantime, we get EPIPE. In that case, open a fresh connection and ;; retry. We might also get 'bad-response or a similar exception from - ;; (web response) later on, once we've sent the request. + ;; (web response) later on, once we've sent the request, or a + ;; ERROR/INVALID-SESSION from GnuTLS. (if (or (and (eq? key 'system-error) (= EPIPE (system-error-errno `(,key ,@args)))) + (and (eq? key 'gnutls-error) + (eq? (first args) error/invalid-session)) (memq key '(bad-response bad-header bad-header-component))) (proc (open-connection uri #:fresh? #t)) (apply throw key args)))))) --=-=-=--