From b45f970e40dad00e13f76e4e1bfeacdd320a3123 Mon Sep 17 00:00:00 2001 From: ghe0 Date: Sun, 22 Dec 2024 20:48:19 +0200 Subject: [PATCH] fix deadlock for ghost nodes --- src/data.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/data.rs b/src/data.rs index c239618..eddacca 100644 --- a/src/data.rs +++ b/src/data.rs @@ -207,7 +207,9 @@ impl BrainData { mut req: grpc::NewVmRequest, tx: OneshotSender, ) { - req.uuid = uuid::Uuid::new_v4().to_string(); + let uuid = uuid::Uuid::new_v4().to_string(); + + req.uuid = uuid.clone(); info!("Inserting new vm request in memory: {req:?}"); self.tmp_vmrequests .insert(req.uuid.clone(), (req.clone(), tx)); @@ -223,6 +225,14 @@ impl BrainData { "Daemon {} RX dropped before sending update. Cleaning memory...", req.node_pubkey ); + self.submit_vmconfirmation(grpc::NewVmConfirmation { + error: "Daemon is offline.".to_string(), + uuid, + exposed_ports: Vec::new(), + public_ipv4: "".to_string(), + public_ipv6: "".to_string(), + }) + .await; } } }