Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue of repeated UE connection and disconnection causes no response to Deregistration Request #16

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pfcp/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package handler
import (
"context"
"fmt"
"time"

"github.com/free5gc/openapi/models"
"github.com/free5gc/pfcp"
Expand Down Expand Up @@ -279,6 +280,8 @@ func HandlePfcpSessionDeletionResponse(msg *pfcpUdp.Message) {
}

if pfcpRsp.Cause.CauseValue == pfcpType.CauseRequestAccepted {
waitForPFCPModificationCount := 10
spin:
if smContext.SMContextState == smf_context.PFCPModification {
upfNodeID := smContext.GetNodeIDByLocalSEID(SEID)
upfIP := upfNodeID.ResolveNodeIdToIp().String()
Expand All @@ -288,6 +291,16 @@ func HandlePfcpSessionDeletionResponse(msg *pfcpUdp.Message) {
if smContext.PendingUPF.IsEmpty() {
smContext.SBIPFCPCommunicationChan <- smf_context.SessionReleaseSuccess
}
} else if smContext.SMContextState == smf_context.Active {
waitForPFCPModificationCount--
if waitForPFCPModificationCount > 0 {
logger.PfcpLog.Tracef("smf_context is still Active, retrying. count: %d", waitForPFCPModificationCount)
time.Sleep(1 * time.Millisecond)
goto spin
}
logger.PfcpLog.Debugln("Timeout waiting for sm_context status change from Active")
smContext.SBIPFCPCommunicationChan <- smf_context.SessionReleaseFailed
logger.PfcpLog.Infof("PFCP Session Deletion Failed[%d]\n", SEID)
}
logger.PfcpLog.Infof("PFCP Session Deletion Success[%d]\n", SEID)
} else {
Expand Down