Skip to content

Fix releaseTunnel() race condition affecting PFCP Session Deletion Response handling #83

Description

@anaswarac-dac

Issue/Feature Description:
A race condition exists in the releaseTunnel() function during PFCP session deletion. The PendingUPF map is populated while PFCP Session Deletion Requests are being sent. If a UPF responds quickly, its response may be processed before all remaining UPFs have been added to PendingUPF. This can cause PendingUPF.IsEmpty() to return true prematurely, resulting in early session cleanup before all PFCP Session Deletion Responses have been received.

During longevity testing, this race condition resulted in intermittent SM Context establishment failures. AMF returned "Server No Response" because the SMF session was cleaned up prematurely.
Why this issue to fixed / feature is needed(give scenarios or use cases):
The SMF must wait for PFCP Session Deletion Responses from all participating UPFs before completing tunnel release and cleaning up the session.

Without this fix:

Fast PFCP responses can race with PendingUPF population.
Session cleanup may occur before all UPFs have responded.
This leads to intermittent failures during heavy load or longevity testing.
AMF may fail SM Context Create procedures with a "Server No Response" error due to the premature cleanup.

The fix ensures that PendingUPF is completely populated before any PFCP Session Deletion Requests are sent, guaranteeing that cleanup occurs only after all expected responses have been received.
How to reproduce, in case of a bug:

Other Notes / Environment Information: (Please give the env information, log link or any useful information for this issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions