open5gs/lib
Sukchan Lee b3169c8ee9 sbi: cleanup NRF subscriptions before NF re-registration
When an NF loses heartbeat and enters re-registration, existing
NRF subscription states tied to the previous NF instance remain
both remotely (NRF) and locally (subscription_data pool).

In environments with repeated heartbeat loss or timing races
(e.g., docker-compose deployments), this leads to continuous
re-subscription loops and unbounded growth of
subscription_data entries, eventually exhausting the pool and
triggering assertion failures in ogs_sbi_subscription_data_add().

This patch introduces a pre-registration cleanup mechanism:

- Send DELETE requests for all subscriptions associated with
  the NF instance before re-registration.
- Perform asynchronous local cleanup in the unsubscribe
  response handler (avoiding use-after-free and double free).
- Add duplicate DELETE guard using subscription flags.
- Improve logging visibility for subscription cleanup flow.

This ensures that stale NRF subscription states are removed
and prevents subscription_data pool exhaustion during
re-registration loops.

Issues: #4207
2026-02-12 16:17:49 +09:00
..
app [MME] Add Emergency Number List to "Attach Accept" NAS message 2025-10-27 21:28:53 +09:00
asn1c [MME] unify TAU procedure handling and BCS check across all S1AP cases(#4112, #4113, #4117) 2025-10-25 21:31:45 +09:00
core sec: handle TLV pool exhaustion gracefully during parsing 2026-01-11 14:32:35 +09:00
crypt clang scan-build static analysis findings/resolutions (#3387) 2024-08-16 16:42:12 +09:00
dbi Merge branch 'main' into home-routed 2025-04-06 18:37:36 +09:00
diameter diameter: Prevent crash on malformed CER by removing fatal assert 2025-11-30 15:36:33 +09:00
gtp Follow-up on #4220, #4221 2026-01-11 16:02:28 +09:00
ipfw pfcp/ipfw: Improve error handling in PDR creation/update and ipfw rule parsing 2025-11-20 16:39:17 +09:00
metrics [metrics] fix memory leak 2025-11-13 20:02:25 +09:00
nas Follow up on #4102 2025-10-27 21:31:21 +09:00
ngap [MME/AMF] Fixed crash following Handover Request (#3014) 2024-02-29 23:02:38 +09:00
pfcp core,gtp,pfcp,sgwc: avoid fatal asserts on pool and timer exhaustion 2025-12-30 11:49:40 +09:00
proto Fix DNN Operator-Identifier format and refactor OI parsing for HR roaming interop 2025-12-06 22:23:34 +09:00
s1ap [Release-17] Upgrade S1AP/NGAP to v17.3.9 2023-02-21 21:48:06 +09:00
sbi sbi: cleanup NRF subscriptions before NF re-registration 2026-02-12 16:17:49 +09:00
sctp [PFCP] Refactor PFCP address handling (#3431) 2025-01-11 20:33:02 +09:00
tun [AMF] Follow-up on #3880 2025-06-17 17:34:18 +09:00
meson.build [SEPP] Initial Update for 5G Roaming (#2739) 2023-11-19 19:34:51 +09:00