Repository navigation
Conversation
…ended monitor hosting-dump-analyze grouped clrstack threads by identical stack and kept the largest groups. The thread syncblk names as the owner of a monitor other threads wait for has a stack of its own, so the cut dropped exactly the stack a wedge is read from. On the first production read 21 threads waited on one monitor and its owner was among the 46 of 86 groups cut. Each lock owner is now a group of its own, sorted first (most waiters first), kept at four times the frame cap and labelled in its first frame line. The fact carries lockOwners with shown / cut / no managed stack, and the run log prints it. Refs #6391 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…s-names-lock-owners
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Uncontended monitors are incorrectly treated as lock owners, and two new stack-status branches lack coverage.
0 open findings
What changed in this PR
Improves dump analysis by preserving and identifying monitor-owner stacks during deadlock diagnosis.
Changes:
- Parses
syncblkand prioritizes lock-owner stacks. - Adds lock-owner metadata, labels, logging, and tests.
- Documents the enhanced analysis output.
| File | Description |
|---|---|
deploy/aks/operator/bin/hosting-dump-analyze |
Extracts and prioritizes monitor owners. |
deploy/aks/operator/test/run-tests.sh |
Tests lock-owner grouping and retention. |
src/MeshWeaver.Documentation/Data/Architecture/DebuggingNativeCrashes.md |
Documents lock-owner analysis. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
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.
What changed
deploy/aks/operator/bin/hosting-dump-analyze(theAnalyzeDumpinstance action's one step) condensesclrstack -allinto stack groups and keeps as many as fit the operations lane's log tail. It now readssyncblkfirst:[LOCK OWNER: holds the monitor 21 thread(s) wait for (syncblk owner System.Object)]. The label rides inframes, which the control plane already carries, so the page atOps/Dumps/<action>shows it without a paired change.lockOwners: [{thread, waiters, object, stack}], withstackone ofshown,cut,no managed stack. The run log prints one line per owner.Why
The first production read of a wedged portal (
Ops/Actions/analyzedump-memex-cloud-20261011-ltlwc-2, the pod behind MeshWeaver#6391) answered everything except the one question it was filed for:syncblk: sync block 2,MonitorHeld 43(21 waiters), owner OS thread0x1e; sync block 169,MonitorHeld 9(4 waiters), owner0xf1.Autofac.Core.Lifetime.LifetimeScope.CreateSharedInstance, among them the stalled create (MeshExtensions.BuildPostCreationHandlers), two grain activations (MessageHubGrain.ResolveHubConfigurationObservable), Orleans codec creation and ASP.NET's endpoint matcher.0x1eis in none of the 40 groups. Its stack is shared with nobody, 86 groups were found, and the cut keeps the largest.So the reading names the lock and its owner's thread id, and not what that thread is doing.
How tested
deploy/aks/operator/test/run-tests.sh(theOperator scripts (shellcheck + behaviour)lane):0x2cowns the monitor and0x2dhas the same frames.0x2cis now group 0, alone, labelled, andlockOwnerssaysshown.syncblkowner withMonitorHeld 43, the highest-numbered of 400 single-thread groups. Asserted: it is group 0, deeper than the frame cap, 21 waiters named,lockOwners[0].stack == "shown", and the fact still fits the 14,000-byte budget.With the fix:
907 passed, 0 failed. Withbin/hosting-dump-analyzereverted and the new tests kept:902 passed, 5 failed(stack grouping, lock owner first, lockOwners, the log line, the owner surviving the cut).shellcheckon the script reports only the pre-existing SC1091 note. The in-pod half (_dump_analyze_pod.sh) is unchanged and does not run on macOS; CI runs it.Not covered
Monitorlocks appear insyncblk. ASystem.Threading.Lockowner is not found this way.AnalyzeDumpof the same dump (it is still on the volume) show what OS thread0x1eholds the lock for.Refs #6391
🤖 Generated with Claude Code