Skip to content

[engine] Interrupt handling in parallel graph algorithms merges partial results instead of aborting (wrong answers) #4951

Closed

Description

@lvca

Severity: MEDIUM (silently wrong results on query-kill)

Location: function/graph/GraphAlgorithms.awaitFutures:112-114 (on InterruptedException sets the flag and continues; subsequent f.get() throw, method returns and merges partial chunks), GAVFusedChainOperator.java:209-211 and :295-297 (break then merge), PartitionedTriangleOp.java:100-103 (same, plus abandoned tasks keep writing partialCounts while the caller sums it - array data race).

A PageRank/BFS/Cypher-traversal/triangle query interrupted by a timeout or kill returns incomplete results as success instead of failing.

Fix: on interrupt, cancel outstanding futures and throw (CommandExecutionException/TimeoutException); never merge partial state. Extract one shared await(futures, deadline) helper (the SQLFunctionVectorSparseNeighbors fan-out is the model: shared deadline, drain-all, cancel-on-interrupt) and use it everywhere.


Filed from an internal engine deep-audit (2026-07). Traced to source; verify against current main before fixing and add a regression test.

Activity

  1. added
    audit
    concurrency
    on Jul 4, 2026
  2. added this to the 26.8.1 milestone on Jul 4, 2026
  3. added 2 commits that reference this issue on Jul 5, 2026
  4. lvca commented on Jul 6, 2026

    @lvca
    MemberAuthor

    Fixed in #5009 (merged). GraphAlgorithms.awaitFutures now cancels the outstanding chunks and throws CommandExecutionException on interrupt (flag preserved; a pre-interrupt chunk failure is attached as suppressed) instead of returning normally and letting callers merge partial per-chunk results as a successful answer. The GAV fused-chain operator and the partitioned triangle count (which also summed a partialCounts array that abandoned tasks were still writing) reuse the same hardened helper. The equivalent silent-partial anti-pattern on the SQL parallel-scan path was closed in the same PR: a failed producer fails the query instead of shrinking its result set.

  5. added a commit that references this issue on Aug 14, 2026
  6. added 2 commits that reference this issue on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    auditbugconcurrency

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions