From 24af657fd5f0f706c83a8c6c42282f4af9bca73c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcel=20M=C3=A4rtens?= Date: Tue, 13 Oct 2020 20:05:45 +0200 Subject: [PATCH] quickfix for closing participants more reliable --- network/src/participant.rs | 3 +++ network/src/prios.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/network/src/participant.rs b/network/src/participant.rs index a9af90834b..4734040760 100644 --- a/network/src/participant.rs +++ b/network/src/participant.rs @@ -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"); diff --git a/network/src/prios.rs b/network/src/prios.rs index ca8ec22bc8..98bf65389c 100644 --- a/network/src/prios.rs +++ b/network/src/prios.rs @@ -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 {