From a329d06c0d81d7282a567fceb2d0a8c4c5e29a2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=9E=97=E4=BC=9F?= Date: Fri, 19 Apr 2024 14:23:50 +0800 Subject: [PATCH] Fix a bug --- ballista/scheduler/src/cluster/kv.rs | 3 +++ ballista/scheduler/src/scheduler_server/grpc.rs | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ballista/scheduler/src/cluster/kv.rs b/ballista/scheduler/src/cluster/kv.rs index e0d4d4c2..5e19a3d4 100644 --- a/ballista/scheduler/src/cluster/kv.rs +++ b/ballista/scheduler/src/cluster/kv.rs @@ -327,6 +327,9 @@ impl metadata.value().clone() } else { let value = self.store.get(Keyspace::Executors, executor_id).await?; + if value.is_empty() { + return Err(BallistaError::Internal(format!("Executor {} not registered", executor_id))) + } let decoded = decode_into::(&value)?; self.executors .insert(executor_id.to_string(), decoded.clone()); diff --git a/ballista/scheduler/src/scheduler_server/grpc.rs b/ballista/scheduler/src/scheduler_server/grpc.rs index 4a21ec95..63c4b162 100644 --- a/ballista/scheduler/src/scheduler_server/grpc.rs +++ b/ballista/scheduler/src/scheduler_server/grpc.rs @@ -180,9 +180,7 @@ mod test { use super::{SchedulerGrpc, SchedulerServer}; - // TODO fixme #[tokio::test] - #[ignore] async fn test_register_executor_in_heartbeat_service() -> Result<(), BallistaError> { let cluster = test_cluster_context();