Skip to content

Commit 42d4a11

Browse files
authored
fix validator status check aborts too early (#396)
1 parent cdcfef1 commit 42d4a11

File tree

1 file changed

+42
-6
lines changed
  • crates/validator/src/validators/synthetic_data

1 file changed

+42
-6
lines changed

crates/validator/src/validators/synthetic_data/mod.rs

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,22 @@ impl SyntheticDataValidator {
820820
pub async fn process_work_keys(self, work_keys: Vec<String>) -> Result<(), Error> {
821821
debug!("Processing work keys: {:?}", work_keys);
822822
let validation_plan = self.build_validation_plan(work_keys).await?;
823-
debug!("Validation plan: {:?}", validation_plan);
823+
debug!(
824+
"Number of single trigger tasks: {}",
825+
validation_plan.single_trigger_tasks.len()
826+
);
827+
debug!(
828+
"Number of group trigger tasks: {}",
829+
validation_plan.group_trigger_tasks.len()
830+
);
831+
debug!(
832+
"Number of status check tasks: {}",
833+
validation_plan.status_check_tasks.len()
834+
);
835+
debug!(
836+
"Number of group status check tasks: {}",
837+
validation_plan.group_status_check_tasks.len()
838+
);
824839

825840
let self_arc = Arc::new(self);
826841
let cancellation_token = self_arc.cancellation_token.clone();
@@ -896,14 +911,35 @@ impl SyntheticDataValidator {
896911
}
897912
}
898913
});
914+
let all_tasks_future = async {
915+
let (trigger_res, group_trigger_res, status_res, group_status_res) = tokio::join!(
916+
trigger_handle,
917+
group_trigger_handle,
918+
status_handle,
919+
group_status_handle
920+
);
921+
922+
if let Err(e) = trigger_res {
923+
error!("Single trigger task panicked: {:?}", e);
924+
}
925+
if let Err(e) = group_trigger_res {
926+
error!("Group trigger task panicked: {:?}", e);
927+
}
928+
if let Err(e) = status_res {
929+
error!("Single status task panicked: {:?}", e);
930+
}
931+
if let Err(e) = group_status_res {
932+
error!("Group status task panicked: {:?}", e);
933+
}
934+
};
899935

900936
tokio::select! {
901-
_ = trigger_handle => (),
902-
_ = group_trigger_handle => (),
903-
_ = status_handle => (),
904-
_ = group_status_handle => (),
937+
_ = all_tasks_future => {
938+
info!("All validation sub-tasks completed for this cycle.");
939+
},
940+
905941
_ = cancellation_token.cancelled() => {
906-
warn!("Validation cancelled");
942+
warn!("Validation processing was cancelled.");
907943
}
908944
}
909945

0 commit comments

Comments
 (0)