fix(#461): release configuration write lock around locator.configure()#466
Conversation
Performance Report (Linux) ✅
Legend
|
Performance Report (macOS)
Legend
|
Performance Report (Windows) ➖
Legend
|
Test Coverage Report (Linux)
Coverage increased! Great work! |
Test Coverage Report (Windows)
Coverage increased! Great work! |
There was a problem hiding this comment.
Pull request overview
This PR fixes a performance regression where configure held the configuration RwLock write guard across potentially slow locator.configure() I/O, which could block refresh-side configuration.read() calls and inflate pet.refresh latency (Fixes #461). The change restores the pre-#416 concurrency behavior while preserving the “publish new generation only after all locators are configured” invariant.
Changes:
- Add a
configure_in_progressmutex to serialize overlappingconfigureRPCs without using the configurationRwLockas the serialization mechanism. - Refactor
apply_configure_optionsinto “prepare (snapshot) → configure locators (no config lock) → publish (short write lock)” phases. - Update existing configure test expectations and add new tests for refresh non-blocking behavior, configure serialization, and panic rollback behavior.
Show a summary per file
| File | Description |
|---|---|
| crates/pet/src/jsonrpc.rs | Introduces configure_in_progress and restructures apply_configure_options to avoid holding configuration.write() during locator configuration; adds/updates concurrency regression tests for #461. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 3
| @@ -0,0 +1,569 @@ | |||
| # PET Regression Investigation — Response to May 25 Report | |||
There was a problem hiding this comment.
@copilot -569
[Architect] This 569-line dated investigation document references specific insider build versions (1.33.2026051401, etc.), SQM IDs, and time-sensitive action items ("Target: end of week"). It will become stale quickly. Consider moving this to a GitHub issue, wiki page, or discussion thread where it can be updated/closed — checked-in docs/ files tend to remain as outdated artifacts.
[verified]
There was a problem hiding this comment.
Removed the dated investigation document from docs/ in commit ebf4dfa.
## Summary Run the Homebrew setup commands in the `homebrew/brew` container as the `linuxbrew` user instead of root, while discovering the `brew` executable from the container PATH at runtime. The container job still runs as root so GitHub Actions checkout/tooling can write to the mounted workspace, but recent `homebrew/brew` images have been brittle when `brew install` itself runs as root. PR #466 is currently failing before Rust setup/tests with Homebrew crashing while pouring the `ca-certificates` bottle: ```text undefined method '[]' for nil /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/utils/bottles.rb:127:in 'Utils::Bottles.load_tab' ``` This PR keeps the existing container shape but switches the install step to: ```bash brew_bin="$(command -v brew)" su linuxbrew -c "${brew_bin} update || true" su linuxbrew -c "${brew_bin} install python@3.12 python@3.11" ``` That avoids hardcoding the Linuxbrew prefix while still avoiding root-owned Homebrew install behavior. ## Validation This is a CI-only workaround. The useful validation is the `ci-homebrew-container` Actions job on this PR.
Fixes #461