From e6399ade78d511fc0c7d68f778334c3da9c643fe Mon Sep 17 00:00:00 2001 From: Nicolas Joseph Date: Tue, 15 Oct 2024 19:30:33 -0400 Subject: [PATCH] fix: remove process starting outside of the leadership lock (#1834) --- apps/framework-cli/src/framework/core/execute.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/framework-cli/src/framework/core/execute.rs b/apps/framework-cli/src/framework/core/execute.rs index a6689616..37e12e62 100644 --- a/apps/framework-cli/src/framework/core/execute.rs +++ b/apps/framework-cli/src/framework/core/execute.rs @@ -70,20 +70,20 @@ pub async fn execute_initial_infra_change( ); let mut process_registries = ProcessRegistries::new(project); + processes::execute_changes( + &mut syncing_processes_registry, + &mut process_registries, + &plan.target_infra_map.init_processes(), + metrics, + ) + .await?; + // Check if this process instance has the "leadership" lock if redis_client .has_lock("leadership") .await .map_err(ExecutionError::LeadershipCheckFailed)? { - processes::execute_changes( - &mut syncing_processes_registry, - &mut process_registries, - &plan.target_infra_map.init_processes(), - metrics, - ) - .await?; - // Execute migration changes only if we have the leadership lock migration::execute_changes(project, &plan.changes.initial_data_loads, clickhouse_client) .await