Message ID | e944b76a55fdad935058ac12f2fd19ecfc17ebd5.1741352535.git.mail@cbaines.net |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 04FB127BBEA; Fri, 7 Mar 2025 13:05:04 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H2,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id B42FF27BBE2 for <patchwork@mira.cbaines.net>; Fri, 7 Mar 2025 13:05:03 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1tqXNR-0000Ak-IY; Fri, 07 Mar 2025 08:04:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tqXMx-0008L7-Gr for guix-patches@gnu.org; Fri, 07 Mar 2025 08:04:06 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tqXMx-00051y-2S for guix-patches@gnu.org; Fri, 07 Mar 2025 08:04:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=4XbqrAyk8Bn8Jf4fe2VfwAIygm1oTTfVEzOPaFu97YY=; b=SoAeSEn0BJhYP1Hc5Fb3AMLD5q8PudfnX4TuPX6QcVHE/ui6dz9V7vU/PS3St/9F/I52tjBGvAhbBIfdYRzawxOqveftj6mv/2kTowfcxyi1VTZtYW4muGDrBHGWsR+gm0uh1kbL7gW8nwa05Pr1NHD6f02yiqH4JS9Mf/U6WPu482UNA6hKJDz9zd2xqIwMNm0wlIxRYD+VvzxChDL+f8tP2bh3Rgm81NJ/4kPitVCujCfyVTVvfYgOaEQYtNYGZl+Ech1pP8QpLWZw8UsrE0kquRE35PRWOlS/DBlf5cX3huKScC05fJeiKYP6DGbgvNY113TJEKUD1JB4WM6anQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1tqXMw-0000sq-I4 for guix-patches@gnu.org; Fri, 07 Mar 2025 08:04:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#76811] [PATCH] services: nginx: Replace invoke with spawn-command. Resent-From: Christopher Baines <mail@cbaines.net> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 07 Mar 2025 13:04:02 +0000 Resent-Message-ID: <handler.76811.B.17413526003336@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 76811 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 76811@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17413526003336 (code B ref -1); Fri, 07 Mar 2025 13:04:02 +0000 Received: (at submit) by debbugs.gnu.org; 7 Mar 2025 13:03:20 +0000 Received: from localhost ([127.0.0.1]:47410 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1tqXMF-0000rj-IW for submit@debbugs.gnu.org; Fri, 07 Mar 2025 08:03:19 -0500 Received: from lists.gnu.org ([2001:470:142::17]:55818) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from <mail@cbaines.net>) id 1tqXMD-0000qa-Uh for submit@debbugs.gnu.org; Fri, 07 Mar 2025 08:03:18 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <mail@cbaines.net>) id 1tqXLK-0007ai-0g for guix-patches@gnu.org; Fri, 07 Mar 2025 08:02:26 -0500 Received: from mira.cbaines.net ([2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from <mail@cbaines.net>) id 1tqXLH-00045Y-9R for guix-patches@gnu.org; Fri, 07 Mar 2025 08:02:21 -0500 Received: from localhost (unknown [IPv6:2a02:6b67:e390:8b00::1ce5]) by mira.cbaines.net (Postfix) with ESMTPSA id 880D427BBE2 for <guix-patches@gnu.org>; Fri, 7 Mar 2025 13:02:16 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id 21498c0b for <guix-patches@gnu.org>; Fri, 7 Mar 2025 13:02:15 +0000 (UTC) From: Christopher Baines <mail@cbaines.net> Date: Fri, 7 Mar 2025 13:02:15 +0000 Message-ID: <e944b76a55fdad935058ac12f2fd19ecfc17ebd5.1741352535.git.mail@cbaines.net> X-Mailer: git-send-email 2.48.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a01:7e00:e000:2f8:fd4d:b5c7:13fb:3d27; envelope-from=mail@cbaines.net; helo=mira.cbaines.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, UNPARSEABLE_RELAY=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
[bug#76811] services: nginx: Replace invoke with spawn-command.
|
|
Commit Message
Christopher Baines
March 7, 2025, 1:02 p.m. UTC
I'm not sure where invoke is coming from here, but it could be from (guix build utils), that uses system* which uses waitpid, which might cause problems with recent versions of the shepherd? At least I'm seeing issues on multiple machines where attempting to restart the nginx service sometimes causes the shepherd to hang. * gnu/services/web.scm (nginx-shepherd-service): Replace invoke with spawn-command. Change-Id: Ie9ce4be9a4df121465b28148612b4fbc45fb5126 --- gnu/services/web.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) base-commit: 9bc4c9f521caab8aa8d88aa948a650945bb55838
Comments
Christopher Baines <mail@cbaines.net> skribis: > I'm not sure where invoke is coming from here, but it could be from (guix > build utils), that uses system* which uses waitpid, which might cause problems > with recent versions of the shepherd? > > At least I'm seeing issues on multiple machines where attempting to restart > the nginx service sometimes causes the shepherd to hang. > > * gnu/services/web.scm (nginx-shepherd-service): Replace invoke with > spawn-command. > > Change-Id: Ie9ce4be9a4df121465b28148612b4fbc45fb5126 Hi! ‘invoke’ uses ‘system*’, which is an alias for ‘spawn-command’ (see ‘replace-core-bindings!’ in ‘shepherd.scm’) so the only effect of this patch is that errors from “nginx -c nginx.conf …” would be ignored. I think we need a reproducer for the hang so we can pinpoint the problem because it’s a pretty serious bug! Ludo’.
Ludovic Courtès <ludo@gnu.org> writes: > Christopher Baines <mail@cbaines.net> skribis: > >> I'm not sure where invoke is coming from here, but it could be from (guix >> build utils), that uses system* which uses waitpid, which might cause problems >> with recent versions of the shepherd? >> >> At least I'm seeing issues on multiple machines where attempting to restart >> the nginx service sometimes causes the shepherd to hang. >> >> * gnu/services/web.scm (nginx-shepherd-service): Replace invoke with >> spawn-command. >> >> Change-Id: Ie9ce4be9a4df121465b28148612b4fbc45fb5126 > > Hi! ‘invoke’ uses ‘system*’, which is an alias for ‘spawn-command’ (see > ‘replace-core-bindings!’ in ‘shepherd.scm’) so the only effect of this > patch is that errors from “nginx -c nginx.conf …” would be ignored. Ah, yes, I see, I've tried to verify this and it does seem that the nginx server is using this system* replacement. > I think we need a reproducer for the hang so we can pinpoint the > problem because it’s a pretty serious bug! I did try restarting nginx over and over again in the system test os, but that seemed to work. On a VM I have though, it only takes a few restarts for it to hang, I'm not sure why though.
Hey, > I did try restarting nginx over and over again in the system test os, > but that seemed to work. > > On a VM I have though, it only takes a few restarts for it to hang, I'm > not sure why though. It could be that nginx alone would work well, but combining it with another service that does unusual things triggers the bug. One way to investigate would be to start from ‘bayfront.scm’ (which I think has that problem) and boil it down until we have something that can run in a VM and reproduces the problem. I don’t see any ‘waitpid’ uses left in Shepherd services under gnu/services/*.scm. One thing I found that is risky is ‘guix-data-service-setup-database’: it loads a bunch of (guix-data-service …) modules into PID 1 and runs non-trivial code in there; I strongly recommend doing this in a separate process, similar to how ‘bffe-shepherd-services’ does it. Ludo’.
Ludovic Courtès <ludo@gnu.org> skribis: > One thing I found that is risky is ‘guix-data-service-setup-database’: > it loads a bunch of (guix-data-service …) modules into PID 1 and runs > non-trivial code in there; I strongly recommend doing this in a separate > process, similar to how ‘bffe-shepherd-services’ does it. The guix-data-service tests shows that: https://ci.guix.gnu.org/build/9557216/log Namely: --8<---------------cut here---------------start------------->8--- [ 5.788985] shepherd[1]: Service loopback started. [ 5.790001] shepherd[1]: Service loopback running with value #t. Uncaught exception in task: In fibers.scm: 172:8 6 (_) In shepherd/service/system-log.scm: 180:10 5 (run-system-log #<<channel> getq: #<atomic-box 7fcc8e8?> ?) In srfi/srfi-1.scm: 586:17 4 (map1 (#<input-output: socket 17> #<input: /proc/kmsg?>)) In shepherd/service/system-log.scm: 181:33 3 (_ #<input-output: socket 17>) In fibers/io-wakeup.scm: 72:13 2 (make-wait-operation #<procedure 7fcc8e8b0300 at fiber?> ?) 72:13 1 (make-wait-operation #f #<procedure 7fcc8e8b0300 at fi?> ?) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Wrong type to apply: #<syntax-transformer make-base-operation> --8<---------------cut here---------------end--------------->8--- Here bindings in (fibers io-wakeup) are likely “polluted” by loading guile-fibers-next via the (guix-data-service …) modules. Ludo’.
diff --git a/gnu/services/web.scm b/gnu/services/web.scm index 7593cd2eaa..b46a4db73f 100644 --- a/gnu/services/web.scm +++ b/gnu/services/web.scm @@ -870,7 +870,8 @@ (define (nginx-shepherd-service config) (nginx-action (lambda args #~(lambda _ - (invoke #$nginx-binary "-c" #$config-file #$@args) + (spawn-command + (list #$nginx-binary "-c" #$config-file #$@args)) (match '#$args (("-s" . _) #t) (_