From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 06:14:49 2025 Received: (at submit) by debbugs.gnu.org; 26 Mar 2025 10:14:49 +0000 Received: from localhost ([127.0.0.1]:41527 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txNma-0001rl-JE for submit@debbugs.gnu.org; Wed, 26 Mar 2025 06:14:48 -0400 Received: from lists.gnu.org ([2001:470:142::17]:42290) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txNmX-0001rN-QX for submit@debbugs.gnu.org; Wed, 26 Mar 2025 06:14:46 -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 1txNmK-00065X-23 for bug-guix@gnu.org; Wed, 26 Mar 2025 06:14:33 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1txNmH-0000ww-Dm for bug-guix@gnu.org; Wed, 26 Mar 2025 06:14:31 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 07004B29 for ; Wed, 26 Mar 2025 11:14:27 +0100 (CET) Authentication-Results: hera.aquilenet.fr; none X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id 7U-5fMhGYNy5 for ; Wed, 26 Mar 2025 11:14:26 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 04CB068C for ; Wed, 26 Mar 2025 11:14:25 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: bug-guix@gnu.org Subject: [Shepherd] Competing one-shot service starter gets erroneous failure X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: Sextidi 6 Germinal an 233 de la =?utf-8?Q?R=C3=A9vol?= =?utf-8?Q?ution=2C?= jour de la Blette X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Wed, 26 Mar 2025 11:14:24 +0100 Message-ID: <87cye4ksjj.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Rspamd-Queue-Id: 07004B29 X-Spamd-Result: default: False [-5.10 / 15.00]; NEURAL_HAM(-3.00)[-1.000]; BAYES_HAM(-3.00)[99.99%]; CTYPE_MIXED_BOGUS(1.00)[]; MIME_GOOD(-0.10)[multipart/mixed,text/plain,text/x-patch]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+,1:+,2:+]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[bug-guix@gnu.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_NONE(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DOM_EQ_FROM_DOM(0.00)[] X-Rspamd-Action: no action X-Spamd-Bar: ----- X-Rspamd-Server: hera Received-SPF: softfail client-ip=185.233.100.1; envelope-from=ludo@gnu.org; helo=hera.aquilenet.fr X-Spam_score_int: -11 X-Spam_score: -1.2 X-Spam_bar: - X-Spam_report: (-1.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_SOFTFAIL=0.665 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit 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: -1.0 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable As of 1.0.3, when two clients start the same one-shot service, the one that loses the race never sees the value that was produced by the =E2=80=98start=E2=80=99 method. herd start one-shot & herd start one-shot Here one of the =E2=80=98herd start=E2=80=99 processes will wrongfully fail= with =E2=80=9Cfailed to start service one-shot=E2=80=9D. Instead, it calls =E2=80=98service-running-value=E2=80=99 but that always r= eturns #f because the one-shot service was stopped in the meantime. I=E2=80=99m refe= rring to this bit of =E2=80=98start-service=E2=80=99: (match (get-message reply) (#f ;; We lost the race: SERVICE is already running. (service-running-value service)) ;<- here =E2=80=A6) Attached is a reproducer. Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable diff --git a/tests/one-shot.sh b/tests/one-shot.sh index eeecea7..491eeae 100644 --- a/tests/one-shot.sh +++ b/tests/one-shot.sh @@ -1,5 +1,5 @@ # GNU Shepherd --- Test one-shot services. -# Copyright =C2=A9 2019, 2023-2024 Ludovic Court=C3=A8s +# Copyright =C2=A9 2019, 2023-2025 Ludovic Court=C3=A8s # # This file is part of the GNU Shepherd. # @@ -197,4 +197,35 @@ test "$(cat "$stamp")" =3D "third" $herd start fourth && false $herd start fourth && false =20 +# Check the behavior of two clients competing to start the same one-shot +# service. Both should succeed. + +cat > "$conf" <running transition + +# Both 'herd start' processes should have succeeded. +wait $herd_start_pid1 +wait $herd_start_pid2 + $herd stop root --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Wed Mar 26 07:36:56 2025 Received: (at 77274-done) by debbugs.gnu.org; 26 Mar 2025 11:36:56 +0000 Received: from localhost ([127.0.0.1]:41782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1txP44-0000nf-4o for submit@debbugs.gnu.org; Wed, 26 Mar 2025 07:36:56 -0400 Received: from hera.aquilenet.fr ([185.233.100.1]:55840) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1txP3b-0000mV-Cd for 77274-done@debbugs.gnu.org; Wed, 26 Mar 2025 07:36:27 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id 5A2BBB29 for <77274-done@debbugs.gnu.org>; Wed, 26 Mar 2025 12:36:20 +0100 (CET) Authentication-Results: hera.aquilenet.fr; none X-Virus-Scanned: Debian amavis at hera.aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavis, port 10024) with ESMTP id wRfHHAl6mdwS for <77274-done@debbugs.gnu.org>; Wed, 26 Mar 2025 12:36:19 +0100 (CET) Received: from ribbon (91-160-117-201.subs.proxad.net [91.160.117.201]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 844563B2 for <77274-done@debbugs.gnu.org>; Wed, 26 Mar 2025 12:36:18 +0100 (CET) From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: 77274-done@debbugs.gnu.org Subject: Re: bug#77274: [Shepherd] Competing one-shot service starter gets erroneous failure In-Reply-To: <87cye4ksjj.fsf@inria.fr> ("Ludovic =?utf-8?Q?Court=C3=A8s=22?= =?utf-8?Q?'s?= message of "Wed, 26 Mar 2025 11:14:24 +0100") References: <87cye4ksjj.fsf@inria.fr> Date: Wed, 26 Mar 2025 12:36:17 +0100 Message-ID: <874izgkor2.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 5A2BBB29 X-Spamd-Result: default: False [-6.10 / 15.00]; NEURAL_HAM(-3.00)[-1.000]; BAYES_HAM(-3.00)[99.99%]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_ONE(0.00)[1]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[77274-done@debbugs.gnu.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Rspamd-Action: no action X-Spamd-Bar: ------ X-Rspamd-Server: hera X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 77274-done 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: -0.0 (/) Ludovic Court=C3=A8s skribis: > As of 1.0.3, when two clients start the same one-shot service, the one > that loses the race never sees the value that was produced by the > =E2=80=98start=E2=80=99 method. > > herd start one-shot & herd start one-shot > > Here one of the =E2=80=98herd start=E2=80=99 processes will wrongfully fa= il with =E2=80=9Cfailed > to start service one-shot=E2=80=9D. > > Instead, it calls =E2=80=98service-running-value=E2=80=99 but that always= returns #f > because the one-shot service was stopped in the meantime. I=E2=80=99m re= ferring > to this bit of =E2=80=98start-service=E2=80=99: > > (match (get-message reply) > (#f > ;; We lost the race: SERVICE is already running. > (service-running-value service)) ;<- here > =E2=80=A6) Fixed in f730106fe1cf9a3efc2f327cc5716335585ac92b. Ludo'. From unknown Fri Jun 20 20:03:29 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 24 Apr 2025 11:26:54 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator