Skip to content

Recover planning plans without locks - #477

Open
jakduch wants to merge 2 commits into
Dynflow:masterfrom
jakduch:fix/433-orphaned-planning
Open

jakduch wants to merge 2 commits into
Dynflow:masterfrom
jakduch:fix/433-orphaned-planning

Conversation

@jakduch

@jakduch jakduch commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

Fixes #433

Execution plans can remain in planning forever when their planning lock is missing. Existing invalidation only recovers plans whose lock is owned by a world that no longer exists.

Extend the validity check to find planning plans without a corresponding planning lock. Recovery first acquires a replacement planning lock, reloads the plan, and only then changes its state, preventing concurrent validity checks or an active planner from racing the recovery. Fully planned plans continue to execution; incomplete plans are stopped.

Verified with:

  • regression tests for fully and incompletely planned plans without locks
  • bundle exec ruby -Itest test/abnormal_states_recovery_test.rb (25 runs, 69 assertions)
  • bundle exec rubocop lib/dynflow/world/invalidation.rb test/abnormal_states_recovery_test.rb
  • bundle exec rake test on Ruby 3.3 / SQLite (404 runs, 1489 assertions)

@jakduch
jakduch force-pushed the fix/433-orphaned-planning branch from 9463f10 to ed2f069 Compare September 26, 2026 11:42

This branch has not been deployed

No deployments
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.

Execution plans in planning without planning lock should be considered broken during invalidation

1 participant