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
it_reasoning_request_limits fuel tests flake under load: the warm query re-materializes #2326
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingbugSomething isn't working as expected
compiled_closures_are_charged_as_query_fuel and property_path_rule_bodies_are_charged_as_query_fuel fail intermittently at tests/it_reasoning_request_limits.rs:162 when grp_reasoning runs with many test threads:
materializing 1275 facts cost 3.6 fuel, reading the cached result 3.6
fuel_covers_materialization_of runs one query twice and expects the second to be served from the reasoning cache, at lower fuel. When it fails, cold and warm cost exactly the same: the warm query materialized again.
jdorety saw the two tests fail in 17 of 40 runs at 64 threads.
The batches don't establish whether #2271 changes the rate: with the same test set, they ranged from 5 to 12 out of 40.
Cause
The reasoning cache (global_reasoning_cache, fluree-db-reasoner/src/cache.rs) is one process-wide LRU of 16 entries. Every concurrently running test in grp_reasoning materializes into it. When 16 other materializations land between this test's two queries, its entry is evicted, and the "warm" query rebuilds it. datalog_materialization_is_cached_across_identical_queries (it_datalog_rules_annotations) assumes the same thing and failed once in the same runs.
Fix
Give these tests a binary of their own, so their materializations can't be evicted by siblings. #2271 did this for its two cache-dependent tests (it_reasoning_lane_cache), which then failed 0 of 40 runs at 64 threads. That needs:
a [[test]] entry with a comment saying why the tests need their own binary;
moving them out of grp_reasoning.rs;
removing their #[path] lines from it.
The alternative, a cache per Fluree instance, would be a product change.
Note: running the grp_reasoning binary directly needs RUST_MIN_STACK set (cargo test applies 8 MB from .cargo/config.toml). Without it, the binary aborts with a stack overflow that looks like a test failure.
P3Backlog: valid, low payoff-per-effortarea:queryQuery execution, planning, fast paths, overlay, result formattingbugSomething isn't working as expected
Activity