fix deadlock for ghost nodes
This commit is contained in:
parent
efc3fb81b2
commit
b45f970e40
12
src/data.rs
12
src/data.rs
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user