fix(linux): bound the foreground process-tree scan - #3674
Draft
caner-akca wants to merge 1 commit into
Draft
Conversation
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one) (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Summary
/proc/<pid>/statper node, so accumulated child/zombie processes made every probe read more over time.process_tree_pidsinsrc/platform/linux.rs) with a 512-node scan limit, truncating the walk while retaining the enqueued shell/foreground-group roots, so the detected agent and normal foreground groups are unchanged and only pathologically large trees are capped. Mirrors the existingCHILD_GROUPS_SCAN_LIMITon the fallback path.Validation
0.8.2at/home/exedev/herdr-fix-3621/stock/target/release/herdr(sha256:b52c743d51046f9173761213b4f05063d7f5c1334753c7e89dfd6e8a71e7452e) showed the server's/proc/<pid>/ioread rate scale with foreground-tree size (18,975/s at 700 descendants → 54,124/s at 2,100, ×2.85); frozen driversha256:7439146b9ba31d48b921a1e4c6bfdb84c5b7cdab548d69680553f3ef88f85c59withHERDR_BIN=/home/exedev/herdr-fix-3621/patched/target/release/herdr(sha256:6f498481b8578918b30346fca1dfc9079aefa082b9b37152f0f4504558a57613) did not (14,519/s → 13,925/s, ×0.95, bounded)foreground_tree_traversal_is_bounded_by_the_scan_limitfailed without the fix and passes at the committedHEADcargo nextest run -E 'test(foreground_tree_traversal_is_bounded_by_the_scan_limit)'passed at the committedHEADjust checkpassed at the committedHEADNotes
Reproduced and validated on a Linux x86_64 host (kernel 6.12, 2 cores). The 100%-
/proc/<pid>/statread attribution and tree-size scaling were confirmed with strace; the accelerated driver grows two pane shells' descendant trees (both above the 512-node bound) and compares the server read rate, standing in for the reporter's real agents accumulating descendants over ~20h.refs #3621