mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'xMAC94x/quick-fix' into 'master'
quickfix for closing participants more reliable See merge request veloren/veloren!1436
This commit is contained in:
commit
663d5aead4
@ -236,6 +236,9 @@ impl BParticipant {
|
||||
// closed
|
||||
if !closing_up && shutdown_send_mgr_receiver.try_recv().unwrap().is_some() {
|
||||
closing_up = true;
|
||||
//FIXME: quickfix for an error that we are WAITING on close confirmation of
|
||||
// streams from prio manager while prio manager is already shut down.
|
||||
async_std::task::sleep(TICK_TIME * 10).await;
|
||||
}
|
||||
}
|
||||
trace!("Stop send_mgr");
|
||||
|
@ -15,6 +15,7 @@ use crossbeam_channel::{unbounded, Receiver, Sender};
|
||||
use futures::channel::oneshot;
|
||||
use std::collections::{HashMap, HashSet, VecDeque};
|
||||
#[cfg(feature = "metrics")] use std::sync::Arc;
|
||||
use tracing::trace;
|
||||
|
||||
const PRIO_MAX: usize = 64;
|
||||
|
||||
@ -176,9 +177,11 @@ impl PrioManager {
|
||||
if let Some(cnt) = self.sid_owned.get_mut(&sid) {
|
||||
// register sender
|
||||
cnt.empty_notify = Some(return_sender);
|
||||
trace!(?sid, "register empty notify");
|
||||
} else {
|
||||
// return immediately
|
||||
return_sender.send(()).unwrap();
|
||||
trace!(?sid, "return immediately that stream is empty");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -249,6 +252,7 @@ impl PrioManager {
|
||||
let cnt = self.sid_owned.remove(&sid).unwrap();
|
||||
if let Some(empty_notify) = cnt.empty_notify {
|
||||
empty_notify.send(()).unwrap();
|
||||
trace!(?sid, "returned that stream is empty");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user