Repository navigation
v3.0.0 refactor: share pool acquisition observation - #376
Conversation
Use one optional-metrics guard for ledger and collector checkout waits. Choose Tokio monotonic time explicitly while retaining the existing advisory-lock clock and all checkout, error, and cancellation boundaries. Add first-poll, unattached cleanup, and SQLx BEGIN boundary regressions. Refs #352
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9716467. Configure here.
|
Qualification and review ledger for
All GitHub checks are terminal: 20 passed, with the optional code automation check skipped and autofix disabled. There are no inline findings or unresolved review threads. The completed independent lanes produced no actionable findings requiring a fix, deferral or rebuttal. Local qualification separately passed 20 focused Rust tests, including real PostgreSQL and both explicitly selected ignored HTTP tests, plus server build, strict all-target Clippy, formatting, gate utility/input checks, metrics/alert generator checks and the alert-deployment matrix. The local integration manifest proves all five expected focused gates executed; the full 272-gate proof comes from CI. The documented clock choice and checkout-before-SQL/BEGIN boundary remain unchanged from the qualified patch. Broader #352 caller conversion and API-role coverage are still outside this slice. The two outstanding independent reports remain review gates; merge readiness is not yet claimed. |
Thermo review dispositions — PR #376Reviewed head:
The coordinator has now confirmed the separate initial Fable adversarial report on |
Rename the async timing boundary to time_pool_acquire and expose it through metrics while leaving the recording hook name unchanged. Consolidate helper tests under events, retaining unique result, clock, cancellation cleanup and concurrency assertions, and remove the ledger free forwarding function. Preserve advisory-lock timing and every PostgreSQL checkout/BEGIN regression. Refs #352
Thermo follow-through pushed —
|
| Finding | Final disposition |
|---|---|
| 1 — helper placement/name | Fixed. The unchanged async timing body now lives beside recording hooks in metrics/events.rs, exposed as metrics::time_pool_acquire; the recording method retains its distinct observe_pool_acquire name. |
| 2 — test ownership | Fixed. Ten helper tests now live in metrics/events/tests.rs; the ledger test module contains its PostgreSQL case and helpers. Consolidation retains the original allocation identity and I/O error, both unattached outcomes, attached/unattached cancellation cleanup, real/paused timing, first-poll behavior and 32-task mixed-outcome recording. |
| 3 — merge advisory-lock guard | Declined for this PR. The proposed conversion changes the explicitly retained standard clock under paused runtimes and expands the acquisition-only scope. Advisory-lock code is byte-for-byte unchanged. No correctness defect is deferred. |
| 4 — forwarding function | Fixed. Ledger::acquire and transaction begin call the shared helper directly; the free forwarding function is removed. |
| 5 — BEGIN regressions | Retained. Every PostgreSQL checkout/BEGIN test statement and assertion is unchanged, including custom delayed/failed/cancelled BEGIN and recovery of the single pool slot. |
Executed validation on the fix
- 17 focused tests passed; none failed or ignored: 10 shared-helper tests, 2 ledger/connect tests, 3 wait-metrics tests, and 2 explicitly selected normally ignored collector/HTTP tests.
- The repository native-test harness provisioned disposable PostgreSQL instances with required integration mode. The manifest checker confirms all 5 expected focused integration gates executed, with no skip/failure decisions.
cargo clippy --locked -p qbit-prism-server --all-targets -- -D warnings,cargo build --locked -p qbit-prism-server, formatting and diff whitespace checks passed.- Direct source comparison proves the timing body changed only by its name/location; advisory-lock code and the entire PostgreSQL test body are unchanged. There is no version bump, new deadline, stored-format or public metric change.
Review status
The initial medium, Codex adversarial and coordinator-confirmed Fable adversarial reviews concern 9716467a32d97c7aa76871aa085978e4e39e18cc. The Fable adversarial result is no refutation found, independently of the supplied thermo report. Focused independent verification of 4689b9e73cd3ce524296d4268b67494550556566 has been requested through the coordinator, and new-head CI is running. The prior head's full CI proof remains historical evidence only. Final-head review qualification remains pending; no merge readiness is claimed and the PR remains unmerged.
CI latency investigation — unchanged head
|
CI latency investigation complete —
|
| Exact evidence | Frontend-2 baseline p99 | Frontend-2 phase-B p99 | Solve ACK | Outcome |
|---|---|---|---|---|
Base d733ef9, run 34907861875 / shard 0 |
7.93 ms | 25.28 ms | 6.74 ms | Passed |
Prior PR head 9716467, run 34910685980 / shard 0 |
309.99 ms | 17.01 ms | 6.39 ms | Passed |
| Current head, attempt 1 / job 104439948560 | 12.01 ms | 397.34 ms | 13.72 ms | Failed the 250 ms bound |
| Same current head, attempt 2 / job 104443770873 | 11.92 ms | 12.56 ms | 7.40 ms | Passed the unchanged 250 ms bound |
The test/fixture, submit and candidate-rebuild paths, dependency lockfile, CI workflow and sharder have identical Git blobs on the base and current head. The observer remains reachable in the submit path, but review found no new wait, SQL, deadline, registry-lock duration or ownership change that explains the tail spike. The original failure affected both frontends during phase B. Its precise cause remains unisolated; a passing retry is not proof of infrastructure. The evidence does not demonstrate a PR regression, so no speculative fix is justified. Original logs, all initial artifacts and digests, and exact historical comparison logs were preserved before the retry.
Artifact provenance and final gates
The successful aggregate job 104445988739 explicitly selected new shard-0 artifact 10404695919, created at 15:24:54 UTC, with digest sha256:d757c2c46f281a609a2ae486ccf6c788edb27684c9dc21d5bb60666a9d03e1c5. Old failed-attempt shard-0 artifact 10403604368, created at 15:13:47 UTC, remains preserved and was not selected. The other selected artifacts were 10404021732 (shard 1), 10404051586 (shard 2), and 10404275838 (shard 3), all successful outputs from this same head.
The uploaded combined manifest (artifact 10403894378) is byte-identical to that exact four-artifact union. Re-running the repository checker against the downloaded manifest and logs confirms 272/272 expected gated tests executed, with 385 manifest lines and 41 repeated test IDs; no expected gate was skipped or missing. Combined manifest SHA256: ac14a80b508c9bf9046de9f6ad85cd351c148f4ef0c85a704b9c5f92af69dbd4.
All current GitHub checks are terminal: 19 successful, plus the optional skipped [code]smith check. Final Fable delta verification remains a separate coordinator-owned lane; this CI closeout does not claim its result or overall merge readiness.
|
Coordinator closeout: independent Fable final-delta verification of 9716467 to 4689b9e completed clean. It independently checked helper equivalence, all unique retained assertions, cancellation, clock boundaries and unchanged PostgreSQL BEGIN tests; focused tests plus disposable PostgreSQL verification, Clippy and formatting passed. This supersedes earlier text saying coordinator verification was pending. Final CI is green with 272/272 gates proved. Merged as 387064c; #352 remains open for the remaining caller and public-role coverage. |
Ledger and collector pool acquisitions now use one observer. The shared observer uses Tokio monotonic time: real elapsed time in an unpaused runtime and the collector's existing controlled clock in paused tests; advisory-lock timing keeps its standard monotonic clock.
The observation starts at first poll, records one success/failure/cancellation result, and ends before SQL or
BEGIN. An unpolled future records nothing, and a checkout without metrics reads no observation clock. Public metrics, labels, roles, results and deadlines stay unchanged.Refs #352. This is the observer-consolidation follow-up to #368; remaining caller conversion and API-role coverage remain separate work.
Validation
Latest fix head:
4689b9e73cd3ce524296d4268b67494550556566.Transaction::beginoperations after checkout. All existing PostgreSQL test statements and assertions are unchanged.34986531965reached terminal success after one unchanged diagnostic rerun: the initial incident-2 latency failure (397.34 ms against 250 ms) passed on retry at 12.56 ms against the same bound. Exact artifact provenance is verified, and the aggregate proof confirms all 272 expected integration gates executed. The original failure and its unresolved cause are retained in the public CI investigation ledger.Review status
Independent medium and Codex adversarial reviews found no actionable regression/refutation on
9716467a32d97c7aa76871aa085978e4e39e18cc. The coordinator has confirmed the separate Fable adversarial review on that head is complete with no refutation found. The supplied thermo report found no correctness regression and requested structural follow-through.The appended fix addresses thermo findings 1, 2 and 4: move/rename the shared timer beside metrics events, consolidate helper tests while retaining unique assertions, and remove the free ledger forwarding function. Finding 3 is declined within this acquisition-only PR because the proposed lock-guard conversion changes the retained standard clock contract under paused runtimes. Finding 5's PostgreSQL coverage is retained. See the public disposition and fix ledger for details.
Focused independent verification of
4689b9e73cd3ce524296d4268b67494550556566remains a separate coordinator-owned lane. New-head CI is complete: 19 checks succeeded, the optional code automation check is skipped, and the exact downloaded artifact union proves 272/272 gated tests executed. The one unchanged retry did not identify the original latency cause, and no speculative fix or threshold change was made. Prior-head reviews are not promoted to the new head; overall merge readiness is not claimed and no merge is authorized.Coverage audit
Independent behavioral estimate: 95% (19/20 scenarios), not measured line or branch coverage. No concrete regression found. The remaining nonblocking test gap is a direct paused-runtime assertion through
Ledger::acquire; its delegation to the shared observer is verified in code, the observer has exact paused-clock tests, and the adapter has real PostgreSQL coverage.Behavioral coverage map
Behavioral estimate: 19/20 reviewed contract scenarios covered (95%); not measured line/branch coverage.
*** = assertions cover behavior, boundary cases, and failure outcomes. Integration-worthy flows above have real PostgreSQL coverage; the live scrape uses HTTP. No LLM/eval paths apply. Coverage gate: PASS (95%, default target 80%). One nonblocking composition-level test gap; no concrete regression found.
Plan completion
Implementation, thermo dispositions and bounded fixes, local qualification, documentation, PR publication and final-head CI qualification are complete. Initial review reports are accounted for; final-head Fable delta verification remains separately owned by the coordinator. No remaining caller coverage or overall merge readiness is claimed by this slice, and the PR remains unmerged.
Documentation
The acquisition guide documents the shared ledger/collector observer, Tokio clock behavior in paused tests, and the unchanged advisory-lock clock. It retains the checkout-only timing boundary and explicit partial coverage of #352. Documentation sync found no additional changes needed.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.