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
Property path with both ends unbound builds its whole closure outside the memory budget #1983
P2Scheduled: real but not urgentarea:queryQuery execution, planning, fast paths, overlay, result formattingbugSomething isn't working as expectedperformancePerformance improvement (release notes: Performance)
A property path with neither end bound (?s ex:p+ ?o, ?s ex:p* ?o) runs PropertyPathOperator::compute_closure in fluree-db-query/src/property_path.rs, and nothing bounds what it builds:
an adjacency map and node set over every edge of the path's predicates (for a wildcard path, every node-to-node edge in the graph);
a Vec of every (start, reachable) pair, which is quadratic in the worst case;
for composite paths (?s (ex:a/ex:b)+ ?o), a separate traversal from each start node.
None of this calls ctx.record_alloc or ctx.checkpoint(). The query memory budget can't stop it and cancellation isn't checked, so on a large enough graph the query ends in the process OOM killer instead of a budget error.
History
Until #1959 the module docs said the both-unbound case was "intentionally an error to prevent accidental full-closure enumeration". The code never enforced that: the (None, None) dispatch already called compute_closure. #1959 corrected the docs; this issue is for the missing guard. Raised in review: #1959 (comment)
Options
Minimum: charge the adjacency map, node set and output pairs to the memory budget (record_alloc plus a periodic checkpoint), so an oversized closure fails with a budget error and can be cancelled.
Stream pairs from one start node at a time instead of materializing the whole output first.
Log a warning when an unbounded closure runs, so it's visible before it becomes an incident.
Related
#1973 is another query shape that ends in OOM rather than a budget error: OPTIONAL with a left-bound variable in object position.
P2Scheduled: real but not urgentarea:queryQuery execution, planning, fast paths, overlay, result formattingbugSomething isn't working as expectedperformancePerformance improvement (release notes: Performance)
Activity