From patchwork Fri Aug 13 10:28:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Othacehe X-Patchwork-Id: 268 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id B227927BC82; Fri, 13 Aug 2021 11:29:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 87CE927BC78 for ; Fri, 13 Aug 2021 11:29:09 +0100 (BST) Received: from localhost ([::1]:49944 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEUR2-0000To-H9 for patchwork@mira.cbaines.net; Fri, 13 Aug 2021 06:29:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEUQw-0000Tg-PF for guix-patches@gnu.org; Fri, 13 Aug 2021 06:29:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57214) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEUQw-0008Bz-De for guix-patches@gnu.org; Fri, 13 Aug 2021 06:29:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mEUQw-0006wE-7p for guix-patches@gnu.org; Fri, 13 Aug 2021 06:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50040] [PATCH 0/2] publish: Always render nar/narinfo during backing. Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 Aug 2021 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 50040 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 50040@debbugs.gnu.org Cc: Mathieu Othacehe X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.162885049026604 (code B ref -1); Fri, 13 Aug 2021 10:29:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Aug 2021 10:28:10 +0000 Received: from localhost ([127.0.0.1]:40526 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEUQ6-0006uy-Ds for submit@debbugs.gnu.org; Fri, 13 Aug 2021 06:28:10 -0400 Received: from lists.gnu.org ([209.51.188.17]:37340) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mEUQ2-0006up-HE for submit@debbugs.gnu.org; Fri, 13 Aug 2021 06:28:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42384) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mEUQ2-0000MP-9X for guix-patches@gnu.org; Fri, 13 Aug 2021 06:28:06 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51410) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mEUQ2-0007Lh-1F for guix-patches@gnu.org; Fri, 13 Aug 2021 06:28:06 -0400 Received: from [2a01:e0a:19b:d9a0:f2f7:a404:c3d3:f8b4] (port=44572 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mEUQ1-0003LR-Ny; Fri, 13 Aug 2021 06:28:05 -0400 From: Mathieu Othacehe Date: Fri, 13 Aug 2021 12:28:00 +0200 Message-Id: <20210813102800.805-1-othacehe@gnu.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello, This patchset does two things: * It ensures that the narinfo creation is always done in a dedicated thread to prevent blocking the main publish thread and cause the timeout connection errors that some users experimented. * It removes the cache bypass support and always renders temporary narinfo and nar files during baking. This way, the first user asking for a substitute won't get a 404 error. It also removes the need for Cuirass to pre-bake nar files. Finally it will make way easier to use a publish server with caching in a CI context. The downside is that it makes the publish server code harder to understand and that it consumes more server resources by duplicating the nar/narinfo file creation. In the long run, spawning new threads constantly won't scale. I think it would be nice to rewrite the publish server using Fiber or an HTTP server framework. Thanks, Mathieu Mathieu Othacehe (2): publish: Defer narinfo string creation to the http-write. publish: Remove cache bypass support. doc/guix.texi | 15 ----- gnu/services/base.scm | 11 +--- guix/scripts/publish.scm | 136 +++++++++++++++++++++++---------------- tests/publish.scm | 88 +++---------------------- 4 files changed, 93 insertions(+), 157 deletions(-)