Skip to content

Commit

Permalink
fix: remove process starting outside of the leadership lock (#1834)
Browse files Browse the repository at this point in the history
  • Loading branch information
callicles authored Oct 15, 2024
1 parent a5a9035 commit e6399ad
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions apps/framework-cli/src/framework/core/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e6399ad

Please sign in to comment.