Skip to content

2.x.x: release stall-probe frame references after sampling - #248

Merged
kiwidream merged 2 commits into
2.x.xfrom
diagnose-prism-wake-delay
Sep 8, 2026
Merged

kiwidream merged 2 commits into
2.x.xfrom
diagnose-prism-wake-delay

Conversation

@kiwidream

@kiwidream kiwidream commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

StallProbe.capture_stacks() kept the dictionary returned by sys._current_frames(), including its own frame. That cycle retained sampled workers and their local data after they finished, until cyclic GC. The defect was reproduced on the deployed Python 3.14.7 runtime during investigation of the continuing Union mainnet lease-monitor alerts.

Release the snapshot and traversal references in finally, including formatting failures and sampling caps. Retained diagnostic state contains formatted text. The existing output, rate limits, metrics, fencing, and monitor exit policy are preserved.

Adds real-thread weak-reference regressions with cyclic GC disabled. All six retention cases failed against the original method and pass with the fix: normal return, a retained formatting-error traceback, thread caps of 0/1, and frame caps of 0/1. An empty-snapshot control also passes. The capacity guide documents ownership and the remaining production measurements.

Validation:

  • Docker shell syntax and ShellCheck 0.11 passed for all tracked shell scripts.
  • Docker Python 3.14.7 compilation passed.
  • 177 focused lease, fencing, background-service, and metrics tests passed on Python 3.14.7 in Docker.
  • 26 mainnet Compose contract tests passed.
  • Linux CI passed: all four Python unit shards, Rust, PostgreSQL ledger/scale/native-client suites, ckpool live tests, and lightweight Docker builds.
  • The local macOS discovery run executed 3,394 tests, with five failures from Linux-only os.splice assumptions and ten skips. All five failures were reproduced unchanged on the 2.x.x baseline.

Independent Fable 5.1 Extra High review through Superset approved the fix with no blockers. The reviewer reproduced the baseline failures, tested cleanup mutations, and passed 228 focused tests on Python 3.14.7 in Docker. Both optional suggestions were addressed: isolate the formatting-failure mock to this module and explain the loop variable's possible self-reference. The reviewer then approved final commit 51a9472, confirmed both findings resolved, and verified the revised test with concurrent logging and mutation checks. The 177-test Docker selection, compilation, and lint passed again after those edits.

Addresses #247; related incident #236 remains open. The ownership defect is confirmed, but its exact contribution to production RSS, GC pauses, and restarts is unmeasured. Deployment and the 350k–400k native-ledger/window/job soak remain follow-up validation; this PR does not claim that all remaining stalls are resolved.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T14:50:07.337817Z 51a9472 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant