fix deadlock for ghost nodes

This commit is contained in:
ghe0 2024-12-22 20:48:19 +02:00
parent efc3fb81b2
commit b45f970e40
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4

@ -207,7 +207,9 @@ impl BrainData {
mut req: grpc::NewVmRequest,
tx: OneshotSender<grpc::NewVmConfirmation>,
) {
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;
}
}
}