[ogar-adapter-csharp] serialize dotnet invocations — REAL fix for flaky shm race (supersedes #181's ineffective env attempt)#182
Merged
Conversation
… 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>
Bugbot couldn't run - usage limit reachedBugbot 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.128verifiziert:/tmp/.dotnet/shm, egal was diese Env-Vars sagen (Session-Dir landet dort, nicht im isolierten Home).rm -rf /tmp/.dotnetvor jedem Lauf) → 4/6 Flake trotz [ogar-adapter-csharp] isolate dotnet CLI home per test — fix flaky NuGet-migration shm race #181.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 (
~/.dotnetfehlt) triggert jeder erstedotnet-Prozess .NETs First-Time-NuGet-Migration, die einen Named Mutex unter/tmp/.dotnet/shm/session<N>öffnet. Zwei gleichzeitige Migrationen verlieren mitmkdir==EEXIST/stat==ENOENT— der intermittierende Fehler aus OGAR #179.Fix
Ein statischer
Mutex-Gate serialisiert alledotnet-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.128lokal installiert. Cold-Start (rm -rf /tmp/.dotnetvor 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