Add JSON output, fix --stuck DaemonSet crashloop#1
Open
allreduce wants to merge 1 commit into
Open
Conversation
Add --json / -j flag for JSONL output (one line per stuck task with timestamp, comm, pid, state, wait_seconds, cpu, kstack). Suppress human-readable noise (headers, "no tasks" messages) in JSON mode. Fix --stuck mode unconditionally overriding --interval, --count, and --waiting with hardcoded values. Now only sets them as defaults when the caller hasn't provided explicit values. This was causing the DaemonSet deployment to exit after ~10s (5 loops × 2s) despite passing --interval 10, leading to CrashLoopBackOff across 1900+ pods. Also fix --stuck early exit: only break on first found result when count is bounded (one-shot mode), not when running as a daemon with --count 0. Minimize ringbuf allocations when not profiling to reduce per-pod memory footprint (64MB+192MB → 4KB+4KB for stuck-task scanning). Signed-off-by: Jenya Lee <jenya@thinkingmachines.ai>
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
--json/-jflag for JSONL output (one line per stuck task with timestamp, comm, pid, state, wait_seconds, cpu, kstack)--stuckunconditionally overriding--interval,--count, and--waitingwith hardcoded values — now only sets them as defaults when the caller hasn't provided explicit values--stuckearly-exit behavior: only break on first found result when count is bounded, not when running as a long-lived daemonProblem
The DaemonSet passes
--stuck --interval 10 --waiting 2, but--stuckhard-overrides interval to 2 and count to 5. rwalker exits cleanly after ~10s, Kubernetes restarts it, and eventually all 1900+ pods enter CrashLoopBackOff.