mirror of
https://github.com/open5gs/open5gs.git
synced 2025-10-23 07:41:57 +00:00
[UPF] Handle session allocation failure gracefully when maximum sessions are reached (#3964)
In upf_sess_add, replace the unconditional assertion on sess with a check that detects when the session pool is exhausted. If allocation fails, log an error message (“Maximum number of Session reached”) and return NULL instead of aborting the process. This change prevents the UPF from crashing when the PFCP session limit (4096) is exceeded and allows it to reject additional session establishment requests cleanly.
This commit is contained in:
@@ -178,7 +178,10 @@ upf_sess_t *upf_sess_add(ogs_pfcp_f_seid_t *cp_f_seid)
|
||||
ogs_assert(cp_f_seid);
|
||||
|
||||
ogs_pool_id_calloc(&upf_sess_pool, &sess);
|
||||
ogs_assert(sess);
|
||||
if (!sess) {
|
||||
ogs_error("Maximum number of Session reached");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ogs_pfcp_pool_init(&sess->pfcp);
|
||||
|
||||
|
Reference in New Issue
Block a user