From debbugs-submit-bounces@debbugs.gnu.org Tue May 18 10:35:34 2021 Received: (at 48468) by debbugs.gnu.org; 18 May 2021 14:35:34 +0000 Received: from localhost ([127.0.0.1]:56847 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj0oo-0007lD-C0 for submit@debbugs.gnu.org; Tue, 18 May 2021 10:35:34 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj0ol-0007kl-Bf for 48468@debbugs.gnu.org; Tue, 18 May 2021 10:35:31 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37814) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj0of-0005tX-Go; Tue, 18 May 2021 10:35:25 -0400 Received: from [2a01:e0a:19b:d9a0:f2f7:a404:c3d3:f8b4] (port=34756 helo=meije) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj0oe-0002Rn-CL; Tue, 18 May 2021 10:35:24 -0400 From: Mathieu Othacehe To: Christopher Baines Subject: Re: bug#48468: substitute server connection timeout References: <87lf8e4l42.fsf@gnu.org> <87eee6cz75.fsf@cbaines.net> <87eee59zzm.fsf@gnu.org> Date: Tue, 18 May 2021 16:35:17 +0200 In-Reply-To: <87eee59zzm.fsf@gnu.org> (Mathieu Othacehe's message of "Mon, 17 May 2021 16:49:49 +0200") Message-ID: <878s4c85zu.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 48468 Cc: Ludovic =?utf-8?Q?Court?= =?utf-8?Q?=C3=A8s?= , bug-guix@gnu.org, 48468@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hey, > I'll have a closer look, thanks for your help. So this snippet in the http-write procedure of the (guix scripts publish) module: --8<---------------cut here---------------start------------->8--- (swallow-zlib-error (close-port port)) --8<---------------cut here---------------end--------------->8--- is closing the client port unconditionally, which means that guix publish cannot keep connections alive, unless sitting behind an Nginx proxy. I'm trying to turn the close-port call into a maybe-close-port with the following procedure: --8<---------------cut here---------------start------------->8--- (define (maybe-close-port port) (cond ((keep-alive? response) (poll-set-add! (http-poll-set server) port *events*)) (else (close-port port)))) --8<---------------cut here---------------end--------------->8--- however this is terribly hacky, as I need to access the private poll-set from (web server http). Ludo, do you have a better idea? Thanks, Mathieu