fix(kanban): propagate deferred scratch-workspace sweep to grandparents - #41829
Open
r266-tech wants to merge 1 commit into
Open
fix(kanban): propagate deferred scratch-workspace sweep to grandparents#41829r266-tech wants to merge 1 commit into
r266-tech wants to merge 1 commit into
Conversation
Contributor
|
Thanks for the focused follow-up. The premise remains valid on current main: The proposed recursive traversal is bounded by Automated hermes-sweeper review. |
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.
Follow-up to #41352 (deferred parent scratch-workspace cleanup).
_try_cleanup_parent_workspaces()sweeps a deferred parent scratch dir once all its children are terminal, but the sweep was non-recursive. In a depth-3+ scratch decomposition chain A->B->C, B's completion defers (C still active), and when leaf C completes it sweeps only its direct parent B and stops — A's scratch dir leaks on disk forever, with no global workspace GC to reclaim it (the only rmtree sites are own-scratch and direct-parent). It accumulates across runs.Fix: after handling each eligible parent, recurse
_try_cleanup_parent_workspaces(conn, parent_id, _visited)so the sweep cascades up the whole chain. The task DAG is acyclic (_would_cycle), and a threaded_visitedset bounds each ancestor to one evaluation per completion cascade so diamond-shaped DAGs aren't re-traversed per path. The optional_visitedkeeps the existing 2-arg callers unchanged.Adds depth-3 chain and diamond-DAG regression tests (existing tests only covered 2-level chains).
If this already landed via a separate patch, feel free to close.