Repository navigation
fix(qa): avoid false zero RSS after a process leader exits - #147407
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 13, 2026, 5:24 PM ET / 21:24 UTC (Revision 2). ClawSweeper reviewWhat this changesQA Lab’s Linux memory sampler now requires an explicit RSS reading for every reachable process and reports unavailable memory instead of a false zero or partial total. Merge readiness⛔ Blocked before merge - 1 item remains This remains a useful, focused fix with no actionable correctness findings. The earlier migration concern is resolved: existing consumers already support unavailable RSS, and no persisted format changes. The merged cleanup repair does not supersede this work. Priority: P2 Review scores
Verification
How this fits togetherQA Lab measures the Gateway process tree during test runs. Its memory sampler feeds runtime summaries, which already exclude unavailable readings from measured samples. flowchart TD
A[Gateway process ID] --> B[Process tree snapshot]
B --> C[Reachable Linux processes]
C --> D[Read kernel memory fields]
D --> E{Every reading available?}
E -->|Yes| F[Total memory in bytes]
E -->|No| G[Unavailable measurement]
F --> H[QA runtime summary]
G --> H
Before merge
Agent review detailsSecurityNone. PR surfaceSource +27, Tests +86. Total +113 across 2 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Keep RSS availability authoritative at the existing sampler and preserve consumers’ established distinction between measured zero and unavailable memory. Do we have a high-confidence way to reproduce the issue? Yes: the supplied Linux worker scenario reaches the actual RSS entrypoint, and current-main source accepts the reported zero ps row. This review verified the source path without executing the fixture. Is this the best way to solve the issue? Yes: repairing availability at the existing producer is narrow and preserves the number-or-null contract; no migration, parallel sampler, or consumer arithmetic change is needed. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 09b032a95282. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
Require an explicit Linux VmRSS value for every reachable process. Preserve unavailable members in the process tree and return null instead of a misleading zero or partial total. CPU and other-platform metric contracts stay unchanged.
d139db1 to
5c89a88
Compare
|
@clawsweeper re-review Please review exact head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Merged via squash.
|
…147407) Require an explicit Linux VmRSS value for every reachable process. Preserve unavailable members in the process tree and return null instead of a misleading zero or partial total. CPU and other-platform metric contracts stay unchanged.
Fixes #147397
The related cleanup repair landed in #147386. This PR contains only the RSS producer repair.
What Problem This Solves
QA memory reports can show zero RSS on Linux after a process leader exits while another thread still holds memory.
User Impact
An unavailable process-tree RSS measurement is reported as unknown (
null), so missing kernel data cannot look like zero memory use. Explicit zero remains valid. CPU measurements and macOS/Windows behavior are unchanged.Why This Change Was Made
Linux RSS measurements now require an explicit
VmRSSvalue for every reachable process in the tree. The collector keeps process topology even when a metric is missing and propagates an unavailable measurement instead of dropping that process or substituting zero.Production: +34/-7 (net +27), required to enforce the existing number-or-null measurement contract. Tests: +92/-6. No persistent process tracker or consumer arithmetic change.
Evidence
nullwhile an independent thread and group-pidfd witness still proved the worker alive.5c89a88e963dfc1dd1cc1864b4d40c97b04b10c5. ClawSweeper reviewed that head with no actionable findings and confirmed the existing compatibility contract.This is a measurement-correctness fix; it does not estimate unavailable RSS or claim a memory reduction.
Data-model Compatibility
No persisted schema or serialized shape changes. The gateway RSS accessor already returns
number | nullinextensions/qa-lab/src/suite-runtime-types.ts:17; summary RSS fields are already optionalnumber | nullinextensions/qa-lab/src/suite-summary.ts:33. The existing sampler excludes unavailable readings from measured samples (suite-run-standard.ts:215), andbuildQaSuiteRuntimeMetricsomits RSS aggregate fields when an endpoint is unavailable (suite.ts:399). These consumers and types are unchanged in this PR.The latest exact-head review confirms this compatibility proof resolves the migration concern, but its generated Before merge checklist still repeats the request. That item is satisfied by the unchanged contracts above: this repair produces the already-supported unavailable result instead of a false measurement. No stored-format migration or upgrade action is required.