Repository navigation
fix(qa): stop shutdown from leaving bus poll timers - #124463
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 16, 2026, 3:39 AM ET / 07:39 UTC. ClawSweeper reviewWhat this changesThe PR makes QA Lab shutdown settle pending long polls and reject late poll or write activity after the server begins stopping. Merge readinessNo blocking findings. The final head resolves the prior late-write concern by fencing mutations at the shared QA bus state owner; keep this maintainer-authored PR open for exact-head CI and normal review. Priority: P2 Review scores
Verification
How this fits togetherQA Lab is a source-checkout testing environment whose HTTP bus receives test messages and long-poll requests. Shutdown must retain the bus through embedded Gateway shutdown, then terminate waiter and mutation ownership before connections finish. flowchart LR
A[QA scenario] --> B[QA Lab HTTP bus]
B --> C[Bus state owner]
C --> D[Long-poll waiters]
B --> E[Inbound message writes]
F[Server shutdown] --> G[Terminal shutdown fence]
G --> C
G --> D
G --> E
Before merge
Agent review detailsSecurityNone. PR surfaceSource +13, Tests +106. Total +119 across 6 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep one terminal shutdown path that first preserves the embedded Gateway ordering, then fences the QA bus owner; the small production increase is warranted because every delayed mutation and waiter must share that owner boundary. Do we have a high-confidence way to reproduce the issue? Yes, by source. Current main closes the HTTP server without terminally closing the bus owner, while the PR's delayed-body tests directly cover the pending poll and late-write race. Is this the best way to solve the issue? Yes. Fencing at the state owner is the narrowest canonical repair because both standalone HTTP requests and combined-lab routes use that owner; socket-only cleanup leaves admitted handlers outside the invariant. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against a2e27de59344. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* fix(qa): settle bus polls during shutdown * fix(qa): fence late bus waiters during shutdown * fix(qa): reject writes after bus shutdown
What Problem This Solves
Fixes an issue where source-checkout QA runs could leave pending QA bus long-poll waiters and timers alive when the standalone bus or combined QA Lab server stopped. That could delay process exit and leave lifecycle state beyond the scenario that owned it.
Why This Change Was Made
The combined lab still completes embedded Gateway shutdown before touching the shared HTTP bus. The HTTP server now fences new requests first, then terminally resets the bus waiter owner so active polls settle and already-admitted late request bodies cannot register a new timer. The standalone bus uses the same terminal shutdown path; ordinary scenario resets remain reusable.
Production code is net +7 lines. No changelog entry is needed because QA Lab and QA Channel are private, source-checkout-only surfaces.
User Impact
QA operators get deterministic shutdown, restart, and scenario isolation without lingering poll timers, handler work, state, or ports. Standard builds and published packages remain unchanged and continue to omit QA Lab and QA Channel.
Evidence
tbx_01m04p2nzfqdf51x2v0h1t8sdg/ run https://github.com/openclaw/openclaw/actions/runs/31932900181: private-QA build passed; source-checkout self-check passed 1 scenario, 3/3 steps, 8 events, zero failures; standard build omitted QA Lab/QA Channel; scopedcheck:changedpassed assertion-safety, types, lint, formatting, plugin boundaries, dead exports, database-first guards, and import cycles.