From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id SLgxI/+NVmQd9AAASxT56A (envelope-from ) for ; Sat, 06 May 2023 19:27:27 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id GG4VI/+NVmRY+QAAauVa8A (envelope-from ) for ; Sat, 06 May 2023 19:27:27 +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 4A243F27B for ; Sat, 6 May 2023 19:27:27 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pvLgX-0000UI-N0; Sat, 06 May 2023 13:27:06 -0400 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 ) id 1pvLgV-0000Tj-2e for bug-guix@gnu.org; Sat, 06 May 2023 13:27:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pvLgU-0004gF-Nv for bug-guix@gnu.org; Sat, 06 May 2023 13:27:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pvLgU-0007r6-IR for bug-guix@gnu.org; Sat, 06 May 2023 13:27:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63190: [Shepherd] Nested calls lead to a hang Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 06 May 2023 17:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63190 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Bruno Victal Cc: 63190@debbugs.gnu.org, bjc@spork.org Received: via spool by 63190-submit@debbugs.gnu.org id=B63190.168339400930171 (code B ref 63190); Sat, 06 May 2023 17:27:02 +0000 Received: (at 63190) by debbugs.gnu.org; 6 May 2023 17:26:49 +0000 Received: from localhost ([127.0.0.1]:35715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvLgG-0007qY-I3 for submit@debbugs.gnu.org; Sat, 06 May 2023 13:26:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55508) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pvLgE-0007qC-3I for 63190@debbugs.gnu.org; Sat, 06 May 2023 13:26:46 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvLg8-0004e6-1K; Sat, 06 May 2023 13:26:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=91AF9i2O44latdmsEE2HnMiUuguYROY0OCtqngLhd8A=; b=R+OXSwBq8vPwDMTSoZWE HKDxDH/teWhLCtq7lUlg2jzaAPbPFfH32cjOc/uyCId5Q84PW1kI50Zdl5wAQWexZpoqkfO88SMlr 1TYw+dHob/jxLR8sy935Xo8iMHYZT9+8frHJKQr+HmvwiXngIPcseqM9JPAIcmHZ0wQFeKmCflksB QaPROISiD07F8tReo+m+spVZ+fGruPnS8vGTpzhPhkRdifm8HHRE18rearTDil5Y4i9vEqpQFwTg3 vpINOMrzjTs4AKv9MpHO9fZG5CcpucrlA9P8wdIkOiJVFe2quylH94q4mB5m7hudKnJtE5cY9YMpF WzmwkdJp8hVX/A==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pvLg7-0006tI-K9; Sat, 06 May 2023 13:26:39 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: Date: Sat, 06 May 2023 19:26:38 +0200 In-Reply-To: (Bruno Victal's message of "Sun, 30 Apr 2023 16:21:14 +0100") Message-ID: <87wn1lid69.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) 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: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1683394047; a=rsa-sha256; cv=none; b=q/jCBkN7fWCua+VOq10ZFebzrAvZAiRXwxFcvjyy1Y7p8axWihiH9rwNm7qlsZsz8CMDAC VHTQhQbaZv/O5Od+2rmEJHyl5KBV5ES5VxDHbsn34oSbKHVbAQDU7DHY94LBqIEJ16fnnQ KxZ26VKm6DbxWflzF6JyKK615klRE9Z6gIN0GlOOAfXp1meO3LbEJq8cJqPVUiZOw1p2jj kbJKWGz7TEe+lpmfXk3VVF9IMYpRXg8qTHKAQdjbIv8SfjuR3KmtuFY/aaqDQn6IXV6NQ6 meHDgunba7JQNrANUeckqAAiCLRBiTpAVrvQ8eC3G7R5nzWJkVWk2Qwesf/L1A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=R+OXSwBq; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1683394047; h=from:from:sender:sender: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=91AF9i2O44latdmsEE2HnMiUuguYROY0OCtqngLhd8A=; b=stU3ozEgRgjfXATI0fwiGa9td/N0xFUzNXUzH30cl7UDKpixFflxuUQrJh3MNW9uWexQyW GlyDpOMY6oKLytZfYPs0HiAmg2FOOxkX5TtC5GF4FZwG9+CMJ3npnCZjxJlw1kilFYHDzL 83htOszrvjPU1qWKtCFuzE97d7y4O4MBBLTAvsaorVm2c5s8yA3dmwPhq4MJ1l1R6eu4A2 coqtjhx+7QTfTXbmnErLyQ53KzdlBdvBdteetl8WS8v0bg4aEqp7yWOw51OvDl+eDjc7yQ ysUE9PiivjOeG1WsbTqDHVQW2Kb+aVIHORbax7MwHiTxiSX/S1u0rH9BoAiwog== X-Migadu-Spam-Score: -2.60 X-Spam-Score: -2.60 X-Migadu-Queue-Id: 4A243F27B X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=R+OXSwBq; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-TUID: 8eFEzGvOGTyM Hi, Bruno Victal skribis: > Original discussion (IRC): [...] > (procedure > #~(lambda (x) > ;; Scenario 1: using code from (gnu services herd), th= is hangs shepherd > #;(start-service 'dummy) ; hangs shepherd (gnu services herd) provides a client to talk to the shepherd process. However, the code of actions runs in the shepherd process itself, so there=E2=80=99s no need to use the client library. Don=E2=80=99t do that. = :-) (Whether that leads to a deadlock depends; at first sight, I=E2=80=99d say there=E2=80=99s no reason for this to deadlock in general, but you can of c= ourse end up with a logic bug like A starts B, which spawns a client to start A, which doesn=E2=80=99t start because it=E2=80=99s waiting for B.) > ;; Scenario 2: this doesn't hang shepherd but do note = that the service has to be re-enabled either manually or automatically here > #;(system* #$(file-append shepherd "/bin/herd") "start= " "dummy-service") This is equivalent to the one above. > ;; Scenario 3: use the already imported (shepherd serv= ice) module, doesn't hang shepherd > ;; Like Scenario 2, the service must be re= -enabled since (respawn? #f) disabled this. > ;; Comment: Won't re-enabling mean that th= is service will relaunch once it quits? > ;; That means the service has to = disable itself on a successful exit, perhaps within the (stop ...) field? > (start 'dummy-service)))))))) This should work without blocking. However, starting a service from another one doesn=E2=80=99t sound great. Could you give more context? Thanks, Ludo=E2=80=99.