Skip to content

[ogar-adapter-csharp] serialize dotnet invocations — REAL fix for flaky shm race (supersedes #181's ineffective env attempt)#182

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/csharp-parity-serialize-real
Jul 8, 2026
Merged

[ogar-adapter-csharp] serialize dotnet invocations — REAL fix for flaky shm race (supersedes #181's ineffective env attempt)#182
AdaWorldAPI merged 1 commit into
mainfrom
claude/csharp-parity-serialize-real

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Warum ein zweiter PR

#181 hat die Falsch-Lösung gemergt. Der dortige Ansatz (TMPDIR/HOME/DOTNET_CLI_HOME/NUGET_PACKAGES pro Test isolieren) behebt den Flake NICHT — jetzt lokal mit dotnet-sdk 8.0.128 verifiziert:

Dieser PR revertet die wirkungslose Env-Plumbing aus #181 und setzt den echten Fix. (Per Doktrin ein frischer PR, da #181 gemerged ist.)

Root Cause (verifiziert)

Die zwei Parity-Tests laufen auf getrennten Threads. Auf einem kalten Runner (~/.dotnet fehlt) triggert jeder erste dotnet-Prozess .NETs First-Time-NuGet-Migration, die einen Named Mutex unter /tmp/.dotnet/shm/session<N> öffnet. Zwei gleichzeitige Migrationen verlieren mit mkdir==EEXIST / stat==ENOENT — der intermittierende Fehler aus OGAR #179.

Fix

Ein statischer Mutex-Gate serialisiert alle dotnet-Aufrufe → die Migration läuft einmal, unumkämpft durch, spätere Aufrufe überspringen sie. Poison wird ignoriert, damit ein echter Assertion-Fail im einen Test den anderen nicht maskiert.

Verifikation (echt, nicht CI-vertraut)

dotnet-sdk 8.0.128 lokal installiert. Cold-Start (rm -rf /tmp/.dotnet vor JEDEM Lauf), CI=1 (erzwingt echten Build+Run statt Skip): 8/8 grün. Derselbe Stress auf dem #181-Stand: 4/6 Flake. Diff = clean origin/main parity.rs + Gate (die #181-Env-Theatre ist entfernt).

🤖 Generated with Claude Code

https://claude.ai/code/session_01Cg8DSUz1U4AvKqXiy9Xx2f

… flaky NuGet-migration shm race (supersedes #181)

#181 merged an env-isolation attempt (TMPDIR/HOME/DOTNET_CLI_HOME/NUGET_PACKAGES
per test) that does NOT fix the flake — verified with dotnet-sdk 8.0.128 that
the .NET named-mutex shm dir stays at /tmp/.dotnet/shm regardless of those
vars, and cold-start stress still flakes ~4/6. This reverts that ineffective
env plumbing and applies the actual fix.

Root cause: the two parity tests run on separate threads; on a cold runner
each first `dotnet` triggers .NET's first-time NuGet migration, which opens a
named mutex under /tmp/.dotnet/shm/session<N>. Two migrations racing lose with
mkdir==EEXIST / stat==ENOENT.

Fix: a static Mutex gate serializes all dotnet invocations, so the migration
completes once uncontended and later calls skip it. Verified: cold-start
(rm -rf /tmp/.dotnet before each run) x8 -> 8/8 green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 8, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_5bb87c93-5316-477c-9619-d9638c141c84)

@AdaWorldAPI AdaWorldAPI merged commit 9e446ef into main Jul 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants