fix(observer): stop panicking on transient OS state - #1916
Closed
blt wants to merge 2 commits into
Closed
Conversation
Under panic=abort, several transient conditions in the observer aborted the whole run, which ADR-004 forbids. The stat sampler skips a stale /proc/<pid>/stat sample after PID reuse instead of asserting, and parses cgroup cpu.max with a bounds-checked helper that returns an error rather than indexing past a truncated read. Descendant listing yields an empty iterator when a target process vanishes instead of unwrapping into a panic. The sample loop treats a procfs, cgroup, or wss read failure as best-effort, logging and skipping that component rather than killing the experiment.
…comm parse(/proc/<pid>/stat) sliced &contents[end_paren + 2..] on the routine per-process CPU-sampling path, assuming two bytes follow the comm's closing ')'. A read truncated at the ')' -- the same transient short-read this commit's sibling guards already defend against -- made that slice panic, aborting the whole run under panic=abort (ADR-004). Use a bounds-checked get() that returns Error::StatMalformed instead, and add a test driving truncated inputs.
Collaborator
Author
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
This was referenced Jul 21, 2026
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.

What does this PR do?
A brief description of the change being made with this pull request.
Motivation
What inspired you to submit this pull request?
Related issues
A list of issues either fixed, containing architectural discussions, otherwise relevant
for this Pull Request.
Additional Notes
Anything else we should know when reviewing?