8000 [Bug]: workflowx parallel node reuses sub-checkpoints across fresh and concurrent runs · Issue #22750 · infiniflow/ragflow · GitHub
[go: up one dir, main page]

Skip to content

[Bug]: workflowx parallel node reuses sub-checkpoints across fresh and concurrent runs #22750

Backlog

Description

@adityajai119

Self Checks

  • I have searched for existing issues, including closed ones.
  • I confirm that I am using English to submit this report.

RAGFlow workspace code commit ID

8c68034

RAGFlow image version

Source checkout (go 1.27.3, pure-Go unit test run with CGO_ENABLED=0); no container image involved.

Other environment information

  • OS: Windows
  • Package: internal/agent/workflowx
  • No external services or native libraries required to reproduce.

Actual behavior

AddParallelNode builds one parallelBridgeState when the node is compiled and captures it in the lambda closure. The inner sub-workflow is compiled with a store backed by that single map. Every compiled.Invoke of the outer workflow therefore reads and writes the same per-item checkpoint map.

Consequences:

  1. A fresh run with a different outer checkpoint ID reuses item checkpoints from an earlier interrupted run: step1 is skipped and the stale result is returned ([101 601] instead of [501 601]).
  2. compose.WithForceNewRun() reuses the same item checkpoints, so an item that should interrupt returns successfully instead.
  3. Two concurrent invocations share one bridge map and leak each other's item checkpoints; both resumes return mixed results ([101 601]).
  4. Completed items keep their sub-checkpoints after a resume, so later resumes carry stale child checkpoints.

Expected behavior

Each parallel invocation owns its own bridge state. Fresh runs and forced-new runs start with empty per-item state; concurrent runs cannot see each other's checkpoints; resuming rehydrates only the checkpoints persisted in the parallel node's own state, and drops them as items complete.

Steps to reproduce

$env:PATH = "C:\Users\tumma\tools\go\bin;$env:PATH"
$env:CGO_ENABLED = "0"
cd <ragflow checkout>
go test -v -count=1 ./internal/agent/workflowx

On the unfixed tree, these new regression tests fail (4 top-level failures, 2 subtest failures):

  • TestParallel_FreshRunIsolatedFromPriorInterruptedRun (sequential and concurrent)
  • TestParallel_ForceNewRunDoesNotReuseSubCheckpoints
  • TestParallel_ConcurrentFreshRunsIsolateSubCheckpoints
  • TestParallel_MultiInterruptResumeDropsCompletedItemCheckpoints

Additional information

Fix: allocate parallelBridgeState inside each runParallelInvoke, register a stateless parallelBridgeStore on the compiled sub-workflow, delete an item's checkpoint after a successful item invocation, and rehydrate only from persisted ItemCheckpoints on resume. All 104 package tests pass with the fix applied; go vet on workflowx, runtime, and dsl is clean.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0