GNU bug report logs

#52555 [RFC PATCH 0/3] Decentralized substitute distribution with ERIS

PackageSource(s)Maintainer(s)
guix-patches PTS Buildd Popcon
Full log

Message #58 received at 52555@debbugs.gnu.org (full text, mbox, reply):

Received: (at 52555) by debbugs.gnu.org; 29 Jan 2022 21:23:20 +0000
From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 16:23:20 2022
Received: from localhost ([127.0.0.1]:34985 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
	id 1nDvBo-0004wE-GS
	for submit@debbugs.gnu.org; Sat, 29 Jan 2022 16:23:20 -0500
Received: from michel.telenet-ops.be ([195.130.137.88]:36426)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <maximedevos@telenet.be>) id 1nDvBm-0004w6-JO
 for 52555@debbugs.gnu.org; Sat, 29 Jan 2022 16:23:19 -0500
Received: from [172.20.10.9] ([188.188.235.49])
 by michel.telenet-ops.be with bizsmtp
 id olPG2600N14dU1006lPH4M; Sat, 29 Jan 2022 22:23:17 +0100
Message-ID: <0b977ae15a49b051c04922d234149a8e4762404f.camel@telenet.be>
Subject: Re: [bug#52555] [RFC PATCH v2 3/5] Add (guix eris).
From: Maxime Devos <maximedevos@telenet.be>
To: pukkamustard <pukkamustard@posteo.net>, 52555@debbugs.gnu.org
Date: Sat, 29 Jan 2022 22:23:16 +0100
In-Reply-To: <20220125192201.7582-4-pukkamustard@posteo.net>
References: <20220125192201.7582-1-pukkamustard@posteo.net>
 <20220125192201.7582-4-pukkamustard@posteo.net>
Content-Type: multipart/signed; micalg="pgp-sha512";
 protocol="application/pgp-signature"; boundary="=-cweAFQCPyDn0FuFp9/8n"
User-Agent: Evolution 3.38.3-1 
MIME-Version: 1.0
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22;
 t=1643491397; bh=UdL72hfwEQ86TmvVgY+UbhOk7FdlnVWCycecXdq0i9w=;
 h=Subject:From:To:Cc:Date:In-Reply-To:References;
 b=Yr/TGmmgPI9CmChS1r4u70zhX/uekutqipEsB68GowejRwXQSRt6YEjGF8FoBog2K
 4SVIcz1T4DMZTofK2MKMuQCqucoRUX4MLB8c/maCksxlVYa4kI0YUXXNO8RYYiQMGa
 YidqyV+L45cTo1oIPxybWl0sL0TARE9lS3iuzhUUQsoXQxfLLVgugd3BjHERKMOM7h
 VO1tSad5R07l80zAWm5JEQc5USY/Er7Ei7e827keYR3R2py+3FUfk0FKemWVNO3oM5
 f9YIkG3h3qapSfkAe5myvZY+mP+jkQ+mTxFGyyqNEZuGzcu4zY5zTFIE1MWZbKjOfE
 5s2NbR6mA6ZhQ==
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 52555
Cc: ~pukkamustard/eris@lists.sr.ht
X-BeenThere: debbugs-submit@debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit@debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request@debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request@debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces@debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
X-Spam-Score: -1.7 (-)
[Message part 1 (text/plain, inline)]
pukkamustard schreef op di 25-01-2022 om 19:21 [+0000]:
> +(define (ipfs-daemon-alive?)
> +  "Attempt to connect to the IPFS daemon. Returns #t if the daemon is alive
> +and #f else."
> +  (with-exception-handler
> +      (const #f)
> +    (lambda _
> +      (let ((response _
> +                      (http-post (string-append (%ipfs-base-url)
> +                                                "/api/v0/version"))))
> +        (equal? 200 (response-code response))))
> +    #:unwind? #t))

This should preferably only be catching exceptions indicating that
the daemon is down (exceptions indicating 404s, or system-errors
indicating network errors, ...).

> +
> +(define guix-eris-block-reducer
> +  (case-lambda
> +
> +    ;; Check if IPFS Daemon is running.
> +    (() (if (ipfs-daemon-alive?)
> +            (eris-blocks-ipfs-reducer)
> +            #f))
> +
> +    ;; Completion. Nothing to do.
> +    ((_) #t)
> +
> +    ((ipfs ref-block)
> +     ;; If IPFS has been initialized store block there
> +     (if ipfs
> +         (eris-blocks-ipfs-reducer ipfs ref-block)
> +         ipfs))))

This (ipfs-daemon-alive?) seems racy, although it's probably not.
Can we do

(define guix-eris-block-reducer
  (case-lambda
    (() (guard (c (oops-it-fails-because-the-daemon-cannot-be-
contacted? c)
                  #false)
          (eris-block-ipfs-reducer))
    [...]))

instead? (I don't think this will work as-is, because from the name and
thunkiness, it would appear that eris-block-ipfs-reducer returns a
procedure ...

Greetings,
Maxime.
[signature.asc (application/pgp-signature, inline)]

Send a report that this bug log contains spam.


debbugs.gnu.org maintainers <help-debbugs@gnu.org>. Last modified: Mon Sep 8 07:17:15 2025; Machine Name: wallace-server

GNU bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.