Skip to content

Commit 2ad6494

Browse files
committed
f1ap-cu: fix F1AP removal procedure, when transaction cancel causes the existing UEs to be removed
1 parent 15bcbd2 commit 2ad6494

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

lib/f1ap/cu_cp/procedures/f1_removal_procedure.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,27 @@ void f1_removal_procedure::operator()(coro_context<async_task<void>>& ctx)
4545
async_task<void> f1_removal_procedure::handle_ue_transaction_info_loss()
4646
{
4747
f1_ue_transaction_info_loss_event ev;
48+
49+
// Add DU UEs to the list of UEs with transaction information lost.
4850
ev.ues_lost.reserve(ue_list.size());
4951
for (auto& ue : ue_list) {
50-
// After receiving an F1 Removal Request, no more F1AP Rx PDUs are expected. Cancel running UE F1AP transactions.
51-
ue.second.ev_mng.cancel_all();
52-
53-
// Add UE to the list of UEs with transaction information lost.
5452
ev.ues_lost.push_back(ue.second.ue_ids.ue_index);
5553
}
5654

55+
// After receiving an F1 Removal Request, no more F1AP Rx PDUs are expected. Cancel running UE F1AP transactions.
56+
// Note: size of ue_list may change during this operation (e.g. if a concurrent UE context release was being
57+
// processed and got cancelled). Therefore, we leverage the list ev.ues_lost for the iteration.
58+
for (ue_index_t ue_idx : ev.ues_lost) {
59+
auto* u = ue_list.find(ue_idx);
60+
if (u != nullptr) {
61+
u->ev_mng.cancel_all();
62+
}
63+
}
64+
ev.ues_lost.erase(std::remove_if(ev.ues_lost.begin(),
65+
ev.ues_lost.end(),
66+
[this](ue_index_t ue_idx) { return ue_list.find(ue_idx) == nullptr; }),
67+
ev.ues_lost.end());
68+
5769
logger.info("{}: F1 Removal Request received, but there are still UEs connected to the DU. Resetting {} UEs.",
5870
name(),
5971
ev.ues_lost.size());

0 commit comments

Comments
 (0)