Skip to content

Fix pipeline stress test: stale completions and busy state#282

Merged
knipknap merged 2 commits into
mainfrom
fix/pipeline-stress-test
Jun 8, 2026
Merged

Fix pipeline stress test: stale completions and busy state#282
knipknap merged 2 commits into
mainfrom
fix/pipeline-stress-test

Conversation

@knipknap

@knipknap knipknap commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Extracted pipeline-only fixes from #278 that address the test_pipeline_stress_random_invalidations stress test failures.

  • Gate _emit_node_state on is_generation_current() — prevents stale task completions from corrupting DAG node state (both step_stage.py and workpiece_stage.py)
  • Check both has_pending_work() and has_tasks() in is_busyartifact_created events can set DAG nodes to VALID before the worker sends its final "done" message, causing has_pending_work() to return False while tasks are still live
  • Skip process_graph() for stale generation completions — avoids processing work from outdated data generations
  • Add _busy_reason() diagnostic — logs why the pipeline reports busy during settle phase, for easier debugging
  • Update test_pipeline_context.py — reflects the new is_busy semantics (active context only, not all contexts)

Tested: stress test passes locally (~2min), all pipeline context tests pass.

Note: the full stress test reliability also depends on the tasker/worker pool changes in #278 (stuck worker detection, early cancel). This PR contains the pipeline-side fixes that are independent and useful on their own.

Gate _emit_node_state on is_generation_current() to prevent stale
task completions from corrupting DAG node state. Check both
has_pending_work() and has_tasks() in is_busy since they can
diverge when artifact_created events arrive before task finalization.
Skip process_graph() for stale generation completions. Add
_busy_reason() diagnostic for settle-phase debugging.
@knipknap
knipknap merged commit e210035 into main Jun 8, 2026
29 checks passed
@knipknap
knipknap deleted the fix/pipeline-stress-test branch June 12, 2026 11:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant