From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id mPSkHthfcWJ6DwAAbAwnHQ (envelope-from ) for ; Tue, 03 May 2022 19:01:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id YCerHdhfcWL/pwAAG6o9tA (envelope-from ) for ; Tue, 03 May 2022 19:01:12 +0200 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 35FD21419E for ; Tue, 3 May 2022 19:01:11 +0200 (CEST) Received: from localhost ([::1]:41710 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlvte-0000z7-58 for larch@yhetil.org; Tue, 03 May 2022 13:01:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlvtW-0000u3-VW for guix-patches@gnu.org; Tue, 03 May 2022 13:01:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlvtW-0000H7-MJ for guix-patches@gnu.org; Tue, 03 May 2022 13:01:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlvtW-0007O6-L0 for guix-patches@gnu.org; Tue, 03 May 2022 13:01:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#55242] [PATCH 07/10] guix: import: go: More resilience wrt network errors; add logging. Resent-From: Attila Lendvai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 03 May 2022 17:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55242 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Maxime Devos Cc: 55242@debbugs.gnu.org Received: via spool by 55242-submit@debbugs.gnu.org id=B55242.165159724827393 (code B ref 55242); Tue, 03 May 2022 17:01:02 +0000 Received: (at 55242) by debbugs.gnu.org; 3 May 2022 17:00:48 +0000 Received: from localhost ([127.0.0.1]:40941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlvtI-00077M-6T for submit@debbugs.gnu.org; Tue, 03 May 2022 13:00:48 -0400 Received: from mail-4022.proton.ch ([185.70.40.22]:43509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlvtE-0006vL-J2 for 55242@debbugs.gnu.org; Tue, 03 May 2022 13:00:47 -0400 Date: Tue, 03 May 2022 17:00:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lendvai.name; s=protonmail3; t=1651597236; bh=h7L6CQXLA/zVYUdaXgPGevvvUN8Yg4/4hkNY2OIHdLY=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=Tv3x7+jtgkCX7MryNRQIICEXKfVefz2aPxxMPGDxxCgIIPnvuv70ozb6EKrQblDD/ dZwocpMppasAzJ0XtAYecNpJExjiotsjpiTRgdEwYcLa1AlovOGeVIbSvaJ7Aoccxk Hdv5uEqH0YTqXzXmMp6KDVevbLQb+dev6F8ep3LEF3Ihs4k/l8J1GnWFrXIurokrHc QdmwTiTt+YrVMiIlDvXuw97cXK8B8FI1izcvO4WeB6t0Gt9kbWTXkCv27HS/oMgrzP EeGpvD7khRNvm+j3LxAXulXG5hxMIpeukNRlX/ptgjLZ1IX7G04dvShaHQhnTTTLdP uKmXEqCVkD92A== From: Attila Lendvai Message-ID: In-Reply-To: <7974a00256e3ee153507f77d6b0a405473e9bbc4.camel@telenet.be> References: <20220503114301.9524-2-attila@lendvai.name> <20220503114301.9524-7-attila@lendvai.name> <7974a00256e3ee153507f77d6b0a405473e9bbc4.camel@telenet.be> Feedback-ID: 28384833:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: Attila Lendvai Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1651597272; 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: content-transfer-encoding:content-transfer-encoding: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=h7L6CQXLA/zVYUdaXgPGevvvUN8Yg4/4hkNY2OIHdLY=; b=U8tvqofGnPRoWCmDd4S04C86tOx3Su10dGJ6bFtgExfxOdByzNaWmG6zyJZvDKWaU41TzU xVzwPD1fGa2ZyHIb0qhcNSgX2QOrlaIAdgc/uxifg1dvmQQOYbmM+BGrxyrEQdfinzXOfi yRL/c3TmxoYBStpAtgB+4n0sr8r8aPtLbMmq0oQvo4zg3kpU8YPk+0bK/qeOZXvlw3JWW5 F4vVrmrWIfK2XQ0YIFgVa+cRTFJK2bcH9DAQceXwoLeto9eSLvzlyuh8elmAJcCIpkRumN NUGw2XZo7mtu7oV9C0uYKbfmNlCsGe4ooqSQjYYRjuVg6xbfrH8fSOlRiHkPkQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1651597272; a=rsa-sha256; cv=none; b=mjdS2wUnQYulHuHloV/r5et+kR0GQFUcZpYGHK43yTcJt8OrbPqePlqlFO70gcJuNzT8S9 FhpoGH3ugxy+BafZIIrIpcTdPyJ4aJfyP6e28f4h4u3L1E6mk6ga1JRJzCQQRxHunOTQvM gxu7nkYXuUtzQWmOU3vhFXc0oB+Q6C9iIxDlfzeZL/Vzg3XEe0VTr7QRdxlNyF9LBAVfqs D+gH2H1c08gSbB0DbMqBCb/ee9H07/3oLoq3gYRWJ58KfOvWaT0E1F/wjwBnQxKs8VBQXu Ac/cJdQ7l7JBGWPPQD8CY+y38K3QPuC9gPREHLHOahl5LqWlGxaJ+pcNS0f0Ug== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail3 header.b=Tv3x7+jt; dmarc=none; 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" X-Migadu-Spam-Score: 1.02 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=lendvai.name header.s=protonmail3 header.b=Tv3x7+jt; dmarc=none; 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" X-Migadu-Queue-Id: 35FD21419E X-Spam-Score: 1.02 X-Migadu-Scanner: scn1.migadu.com X-TUID: XuLR5SnkUsdF > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (let ((port (current-warning-por= t))) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (format port "Unexpe= cted error, will skip ~S.~%reason: " > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 package-name) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; Printing a backtr= ace here is not very useful: it is > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ;; cut off because G= UARD unwinds. > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (print-exception por= t (stack-ref (make-stack #t) 1) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 c (exception-args c)) > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (display-backtrace (= make-stack #t) port)) > > > Why are unknown errors being catched here? *all* errors are caught, displayed, and swallowed, so that the importing ca= n proceed to the rest of the packages. a possible scenario: a large import can take several minutes. if there's a = transient network error, then this way it may finish with 99% of the packag= es, and the rest can be restarted by hand after inspecting the log output. another scenario is that the importer is simply buggy, and the user gets 99= % of the packages imported, and has to do only one package by hand. > What's the '-continuable' for here? Is it to avoid extra 'raise- > exception' entries in the backtrace, or does this actually make use > of Scheme's continuable exceptions? honestly, i can't remember. which translates to: i should have commented on that! *shakes head and makes a mental note* from guile's manual: "If continuable? is true, the handler is invoked in tail position relative to the raise-exception call. Otherwise if the handler returns, a non-continuable exception of type &non-continuable is raised in the same dynamic environment as the handler." i.e. it should rather be called raise-continuably not raise-continuable. and i think the reason is that the stack is not unwound that way, so that the handlers in the guard can print a backtrace showing the entire stack. does this make sense? i'm still learning scheme's stack/exception handling... or maybe what i wanted is that the handlers in the guard can return with (values #f '())? but i think that should work with vanilla RAISE, too. > Why a warning instead of a 'report-error'? because i want the importer to be able to deal with a transitive closures of dependencies with > 400 entries. if it fails at the first error, then a `guix import go -r` becomes a hopeless endeavor for larger go modules. thanks for the review Maxime! i'll address the rest, too. -- =E2=80=A2 attila lendvai =E2=80=A2 PGP: 963F 5D5F 45C7 DFCD 0A39 -- =E2=80=9C'Emergencies' have always been the pretext on which the safeguards= of individual liberty have been eroded.=E2=80=9D =09=E2=80=94 F. A. Hayek (1899=E2=80=931992)