From e2146e90adb1b7dde5c2a534cd84fe4108dd4839 Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Sun, 14 Jun 2020 15:07:06 +0200 Subject: [PATCH] enb: remove usleep after sending RRC Connection Release to UE this cause a "dead-lock" with ZMQ because it made the stack thread sleep for 50ms. With a sync-queue size of 1 (now the default using ZMQ) the zmq-based radio to timeout. as a result the rx/tx between UE and eNB stopped so the UE never reached RRC Idle state. --- srsenb/src/stack/rrc/rrc.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/srsenb/src/stack/rrc/rrc.cc b/srsenb/src/stack/rrc/rrc.cc index a75022ba5..fee772e57 100644 --- a/srsenb/src/stack/rrc/rrc.cc +++ b/srsenb/src/stack/rrc/rrc.cc @@ -537,10 +537,9 @@ void rrc::process_release_complete(uint16_t rnti) if (!user_it->second->is_idle()) { rlc->clear_buffer(rnti); user_it->second->send_connection_release(); - // There is no RRCReleaseComplete message from UE thus wait ~50 subframes for tx - usleep(50000); } - rem_user_thread(rnti); + // delay user deletion for ~50 TTI (until RRC release is sent) + timers->defer_callback(50, [&]() { rem_user_thread(rnti); }); } else { rrc_log->error("Received ReleaseComplete for unknown rnti=0x%x\n", rnti); }