From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=202.12.124.147 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796131196; b=ZFhs7DGGIu1HNHit9X3zhJqF+WhSwZAc7dVDClsEnJwyW/zxG8sz9AfYy+MA4ZPwzz3z KRCS9wo6cIxtN5Zy6s1WcCPR5Wxu/DNOs5Fgug4MeyqCTDIGHSAB3w7x6Ndz3WrqJpaI4 sfjzyIB8RPn6hipGeU4keiTnwwqcBi9dWuboBaZ0Qy0i6whIjPiqDIkL6RC4YXdRnSPNI Ebq9NFc5wUAcsrvBBxw0eNTTpEkNerXO5BFAtJHfglC6Od6svU55jLnL7mEC18oILIaC7 Di2aOwd2uwdeq1LIiCszd+cNFjmwnvVFaaqKeSwY+MRYWcSsZaEvjqDvWvDK6rslBBQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131196; h=DMARC-Filter:Received:Received:DKIM-Signature:DKIM-Signature: X-DKIM2-Info:DKIM2-Signature:X-DKIM2-Info:Message-Instance: X-ME-Sender:X-ME-Received:X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID: Received:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=bz5HaDWUgxy9XWrFY+fEnLd4lphYt3Zi6JeBnuNEkIA=; b=umvgeP367W0f+RCNsuYedEoWZTq2mierogdu3narGK7qtOhxieUBAu4QGnOjFlVGpftY MQGYw1OcA92/Bcs05DLQU20spEMOF3/hzbI0Rlau77ddfMbZJe6FO0T+9FJPZsGP+8f9Y ilAeTxJsieTZafrd2enmbOB1tKD7fDlKT9cEp+w9hmG1HomdNGxZND46SIaJywtqVZQde QA8GY0U82A6wwxYesLS89sGrkTTxR9Kk2JB13MMQICRV+IQnmdA1mXS/fsc0b9snrwKFm xSAd4umuh7YjPI01j+seJdqieKt/DRHn9mh+k2SEZM2NwvTh6dfSp8TMTN3Gf7pP+5w== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=pks.im; spf=pass smtp.mailfrom=pks.im; dkim=pass header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=yriE3f5R; dkim=pass header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=ggo1cwwT; arc=none smtp.remote-ip=202.12.124.147 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67CCC606A330 for ; Tue, 1 Dec 2026 13:19:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 67CCC606A330 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=pks.im Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pks.im Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=pks.im header.i=@pks.im header.a=rsa-sha256 header.s=fm3 header.b=yriE3f5R; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=ggo1cwwT Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfout.stl.internal (Postfix) with ESMTP id B36681D0055C for ; Tue, 1 Dec 2026 08:19:55 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-05.internal (MEProxy); Tue, 01 Dec 2026 08:19:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=cc:cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1796131195; x=1796217595; bh=bz5HaDWUgx y9XWrFY+fEnLd4lphYt3Zi6JeBnuNEkIA=; b=yriE3f5RfU6VrIVmek7KovRvIG jFRM8qAj3oRrCKitixQt1HY0sMNGs2wEgNiuYp4uoCJpf8w6KwEumZ1a2DeI2GPm +t1lsy5po5gF4NUW5ThIJswdwb267TijmaGcA9s8BspiwqXGLz9KHuLUjQt8BI+P YHER37Pya/KecHXTQftAv8Y9BFNjie6SWFyKHDqG9/gL+oUoFOT1/AxizPXV0QkG 5VV1GlRf+fLaEz/CN3zNTuWNJFdmVls9Wy+yKGew+jRbOsHVDZuxk+Ev8KkafsE7 /nqo6VI2IW88+uH89nQGwpxmrJZAtptQDIo0maREvee/VYF0/g/ttY80mgVg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1796131195; x=1796217595; bh=bz5HaDWUgxy9XWrFY+fEnLd4lphYt3Zi6Je BnuNEkIA=; b=ggo1cwwThXosW9zU2TQPWcuQcBdTc05QeJAof3yCeBZc4gDFS2B AFnGOC7DOCc7qC5RHKe92brpA7eAixKuqeiVlu+v4tUwMhxO4k9osySvlLddQDne LNUbmA32bvjDelDQRmoBmjpuMXsO0GIqIdkISYyE2RUXsMKxINHDX3gnRmfvotZS EgF6DN47OXybVHcFv0wrs6PnptWStHT6kSKtvR5wR9ZAtnY/4Dp3xUgxQCAyzhpx KDTCTcPDG5tKqTVssiR/JXWOgeVJH685Uv0005MqvjWq+nIMj0YqgkQYfxGl7/oN qiNvPzHMvkkgU5vO90dlDtnKGsSZULMgYLw== X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=sign d=pks.im a=rsa-sha256; DKIM2-Signature: i=1; m=1; t=1796131195; d=pks.im; mf=PHBzQHBrcy5pbT4=; rt=PGdpdEB2Z2VyLmtlcm5lbC5vcmc+; s=fm3:rsa-sha256:JSE1zCjRpaAq3Qw1vOz4IOIqOulvjfezgSc+tGlhPjSjSrq IiFwS3o/gtphlu8MWIScuJQ/gWy/WSI0RbnsC/3P7Nalt0Le8dEjSlhYrO4s5F9K 89UCmANzrS958BXOeowHJK8nZu0o2i5GsGfuRvstr2C/SdNDLE+PivXtjQX+EyX6 qWpZR49f6zhIgnsZzBtOPufFQ0wMV/0Jw6fibg3RRGK7tCrvQGTmElkUKGYvDsJz L5k7V0HoXHdBdwNJphZ35Njuv44tzEeiPz7oLn7XoeQoJRXS9ifwW9YHeG5f/If2 i73fitknPAZR+l8w7czyscn84a+gcVmSSSnY6Sg==; X-DKIM2-Info: draft=ietf-dkim-dkim2-spec-09; repo=github.com/dkim2wg/interop; date=2026-11-03; sw=lmtpprox; action=mi-m=1; hc=12; hn=cc,content-disposition,content-type,date,feedback-id,from, in-reply-to,message-id,mime-version,references,subject,to; Message-Instance: m=1; h=sha256:RO81JuVmTi9n8sOOoFgBH/47SwsQg2E/TvsZVf1+Ny4=:ZmuJg3W7Ar54cW42TSar/7hOxIm8/qofgaDxQDuMqOA=; X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTFsXE7UryGsq4l2Z3rLmsTyXG6FKA5eTgq92wLSaQOOYvA0ud277odevc6z3Rt0NE TUEryMrehhspu0IfGJOH3iNyrNpYGZUGsktR7JXcQzHNVgaOcQq/s/smVZSsxt8pAC98Cz VXChEVIFEYaAI1VuLiYXmB/oqe0J/ivYxR1eXF9igM4sdg3XjuwrB8orWPbUHUHz7XUF4i 9qowOskdQK7b/oRAJWsyEmMSdgjo7YRVh0U07FMlhQ+/wslv+b6jnV15J8onvwL2iQs417 640lGPCTqaaqu/8xxXW/5xH3le4A0PolUc1a8XpwRVqourXx7KZukiUepo+Ny+k01Cc9of 0i+AGByt3ULgtvtwB7VasVqv3STkB5puI8p/JBAMkVEnRyieseixFVF+NG+H3hoVFzggDG CAupgfAzKjZoEmEQ2KzSfrbs3pFlcYhnq07WviRFZYqUrn9ILJt08ZALegH/afe8rpQOsv j2lrlj9DpI0UfbcmazTl9lBOX9HVPUtSlg2mdogtiYZ2Sgm0N3RwFHHwKzt8tncZ6+JRdk co4dWxOa5yq0FSBqYDKEwKSFljU9q46Qcdon/sJEJirz/3A2VNmFukDI/ebMsh4qbMT6v8 eZ1vuWfSdw8ARTGXwzNZDgWAUyEpBp9up6P7J5vj1Y2B40UeqbRMxtSxPkDw X-ME-Proxy: Feedback-ID: i197146af:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 1 Dec 2026 08:19:54 -0500 (EST) Received: by mail (OpenSMTPD) with ESMTPSA id d73043b5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 1 Dec 2026 13:19:53 +0000 (UTC) Date: Tue, 1 Dec 2026 14:19:49 +0100 From: Patrick Steinhardt To: Kaartic Sivaraam Cc: Git mailing list , Harald Nordgren , Junio C Hamano Subject: Re: [PATCH v4 1/2] test-lib: run EXPENSIVE tests one at a time Message-ID: References: <20261128-ks-ci-long-test-hang-fix-v4-0-f117badd2e13@gmail.com> <20261128-ks-ci-long-test-hang-fix-v4-1-f117badd2e13@gmail.com> <17e17015-53a8-4887-9891-7a7f2f16ea6c@gmail.com> <3fba9f96-47e3-47c0-b540-92af0190fdc3@gmail.com> X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3fba9f96-47e3-47c0-b540-92af0190fdc3@gmail.com> On Tue, Dec 01, 2026 at 06:20:52PM +0530, Kaartic Sivaraam wrote: > On 12/1/26 16:37, Patrick Steinhardt wrote: > > On Tue, Dec 01, 2026 at 02:17:48PM +0530, Kaartic Sivaraam wrote: > > > On 12/1/26 12:52, Patrick Steinhardt wrote: > > > > I feel like re-checking the lock owner is kind of pointless here. The > > > > check doesn't fix the race, but it suggests it to the reader. And that > > > > is overall fine, because the intent now is to fail in a way that we > > > > prefer to run the test instead of blocking forever. > > > > > > > > But it raises the question why we even bother to check again. To me it > > > > only causes puzzlement. > > > > > > > > > > The re-check is present in order to prevent a specific race scenario pointed > > > out by Junio: > > > > > > > * T1 holds $expensive_lock_, finishes its last EXPENSIVE test, > > > > calls release_expensive_lock_ (rm -rf "$expensive_lock_"), and > > > > exits. > > > > > > > > * Waiter T2 read owner=$(cat "$expensive_lock_/pid" 2>/dev/null) > > > > (obtaining T1's PID) just before T1 removed the directory. > > > > > > > > * Waiter T3 runs mkdir "$expensive_lock_", succeeds, writes T3's > > > > PID to pid, and begins its EXPENSIVE test. > > > > > > > > * T2 now checks test -n "$owner" && ! kill -0 "$owner" 2>/dev/null > > > > against T1's exited PID, finds that T1 is gone, runs rm -rf > > > > "$expensive_lock_", which deletes T3's active lock. It loops, > > > > succeeds on mkdir "$expensive_lock_", and runs its EXPENSIVE test > > > > concurrently with T3. > > > > > > > > > It talks about the variant that created directories but it applies for the > > > current linking variant also. > > > > > > If we could improve the comment above the relevant code in someway, do let > > > me know. It tries to convey it but I unfortunately couldn't get what detail > > > it is missing. > > > > But the race isn't fully fixed, is it? You have simply narrowed the race > > window, but the race itself still exists between `test $(cat > > "$expensive_lock_" = "$owner")` and the `rm -f`, doesn't it? > > > > Ah. That is true indeed. Though, without the re-check, makes overlaps after > a SIGKILL more common: in a small stress test they went from about 3 per run > to about 15. So, I kind of lean towards keeping it since it doesn't cost us > much. That's fine with me, but we should at least add a comment there that mentions that this is _not_ a full fix for the race, and why that is acceptable. Patrick