docs: teach the runbook the resurrection race and the lifetime-scoping rule#1187
Merged
Merged
Conversation
…g rule Case study 2 ended by teaching the drop-state-before-clear band-aid that the structural fix (#1186) deleted again; a future reader would copy the wrong pattern. Case study 3 now covers what the follow-up episode taught: the resurrection-race signature (rare, never resolves under gc, cleanup clearing storage that workers also write), the self-diagnosing-test recipe that caught it (dump retainers inside the test past a threshold, crank reproduction with parallel pytest processes - an anomalously slow pass is the same hit), the lazy-accessor re-creation trap, and the rule that makes the whole class of leak disappear: scope storage to its owner's lifetime instead of pairing shared registries with cleanup code. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Answer to "are the runbooks tweaked to find future leaks like this?" — they were half-way: the churn axis and the original use_task case study were already in; this adds what the follow-up episode taught, and removes a rule the handbook was actively teaching wrong.
Proxy → Singleton.get()re-creating what cleanup just cleared), and the structural rule: scope storage to the owner's lifetime; cleanup code paired with shared registries is a patch, and every patch can race.Complements #1186 (the code side of the same lesson). Docs only.
🤖 Generated with Claude Code