Finish mutex lock-order cleanup - #8154
Open
Amaury Chamayou (achamayou) wants to merge 6 commits into
Open
Conversation
Defer member and user frontend initialization out of KV global hooks, publish frontend readiness atomically, and run focused e2e coverage with TSAN deadlock detection before removing the broad KV suppressions. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Amaury Chamayou (achamayou)
August 13, 2026 17:40
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Defers member/user frontend initialization to avoid KV lock-order inversions and strengthens suppression-free TSAN coverage.
Changes:
- Atomically publishes frontend readiness after handler initialization.
- Opens member/user frontends asynchronously.
- Enables deadlock detection and removes broad suppressions.
Custom instructions used:
.github/copilot-instructions.md.github/instructions/reviewing.instructions.md
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
tsan_env_suppressions |
Removes broad KV deadlock suppressions. |
src/node/rpc/test/frontend_test.cpp |
Tests atomic frontend opening. |
src/node/rpc/frontend.h |
Atomically publishes readiness. |
src/node/node_state.h |
Defers member/user frontend opening. |
CMakeLists.txt |
Enables focused deadlock detection. |
cmake/gersemi_definitions.cmake |
Registers the new CMake option. |
cmake/common.cmake |
Propagates deadlock detection to e2e tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Prevent endpoint registry ticks from running while deferred handler initialization is still in progress, and extend the atomic-open regression test to cover tick dispatch. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Summary
open_lockstore.handuntyped_map.hdeadlock suppressionsWhy
The endorsed-certificate and service global hooks could call
RpcFrontend::open()while KV locks were held.open()takesopen_lockand initializes endpoint handlers, extending the hook-side lock chain. The endorsed-certificate hook also queried frontend readiness by taking the same mutex.The hooks now enqueue idempotent frontend initialization on the task system.
RpcFrontend::open()retains its mutex for one-time initialization and release-publishes readiness only afterinit_handlers()completes; readers acquire-load readiness without taking that mutex.The node frontend remains synchronous because boot and in-process node RPC tasks depend on it being available immediately.
TSAN exit criteria
DETECT_DEADLOCKSis now available to e2e tests and is applied to the focused startup/governance/partition coverage as well asfrontend_test. These tests run with deadlock detection enabled, halt on the first report, and do not load repository-wide suppressions.The long TSAN workflow will determine whether AFT startup still reports a lock-order inversion. If it does, this PR will add the two-phase startup change described in #8123 before the suppressions remain removed.
Testing
frontend_test,js_generic, andloggingfrontend_testandledger_secrets_testCloses #8123