Skip to content

Commit

Permalink
Perform invalidation of orphaned locks
Browse files Browse the repository at this point in the history
World invalidation previously relied on world-level lock being present.
All locks belonging to the world which left that lock around would then
be invalidated. If there were any orphaned locks, those would be just
deleted.

With this change, we do proper invalidation for orphaned locks.
  • Loading branch information
adamruzicka committed May 16, 2024
1 parent 7fba55b commit 5e479a7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/dynflow/world/invalidation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,14 @@ def with_valid_execution_plan_for_lock(execution_lock)
# @return [Integer] number of invalidated worlds
def perform_validity_checks
world_invalidation_result = worlds_validity_check
locks_validity_check
locks_validity_check.each do |lock|
case lock
when ::Dynflow::Coordinator::PlanningLock
invalidate_planning_lock(lock)
when ::Dynflow::Coordinator::ExecutionLock
invalidate_execution_lock(lock)
end
end
pruned = connector.prune_undeliverable_envelopes(self)
logger.error("Pruned #{pruned} undeliverable envelopes") unless pruned.zero?
world_invalidation_result.values.select { |result| result == :invalidated }.size
Expand Down

0 comments on commit 5e479a7

Please sign in to comment.