You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Data Branch DAG construction recursively fails on a cyclic parent relation #26083
databranchutils.NewDAG recursively calculates every node depth without tracking nodes already on the current parent walk. A cyclic parent relation such as 1 -> 2 -> 1 therefore recurses until the Go runtime terminates the process.
The snapshot-reclaim DAG already detects and stops cyclic parent walks, but the LCA-oriented DataBranchDAG does not apply the same guard while being built from mo_branch_metadata.
Tested on main commit 2eb7f523e5a10f352d3e258183ed8440510388de.
A focused test executes the call in an isolated child process with a bounded Go stack. The child exits with status 2 in 3 consecutive runs.
Actual result
NewDAG never completes normally. calculateDepth(1) calls calculateDepth(2), which calls calculateDepth(1) again until recursive stack exhaustion terminates the child process.
Expected result
NewDAG should detect a node already present on the current depth-calculation path and either reject the cyclic metadata or build a safe bounded representation. Constructing the DAG must not terminate the process.
Code path
pkg/frontend/databranchutils/branch_dag.go:
NewDAG
DataBranchDAG.calculateDepth
PathFromAncestor and BranchReclaimDag already contain bounded or visited-set walks that can serve as consistency references.
Resolved by #26139, merged into main at 2026-07-24T13:22:26Z. DAG construction is now bounded for cycles and deep chains, detaches only cycle members, and preserves valid descendant edges. Focused and race tests passed, and exhaustive verification covered all 126,125 functional parent graphs with 1-6 nodes. Closing this narrow crash bug as complete.
Activity
fix: prevent recursion failure in data branch DAG cycles (#26139)
VioletQwQ-0 commentedon Jul 27, 2026
Resolved by #26139, merged into main at 2026-07-24T13:22:26Z. DAG construction is now bounded for cycles and deep chains, detaches only cycle members, and preserves valid descendant edges. Focused and race tests passed, and exhaustive verification covered all 126,125 functional parent graphs with 1-6 nodes. Closing this narrow crash bug as complete.
fix: prevent recursion failure in data branch DAG cycles (matrixorigi…
fix: prevent recursion failure in data branch DAG cycles (matrixorigi…
fix: prevent recursion failure in data branch DAG cycles (matrixorigi…