Skip to content

Commit 872660e

Browse files
LSKhappychildlinouxis9
authored andcommitted
Add logic to prevent gNB crash under PDU session create failure
Signed-off-by: LSKhappychild <[email protected]>
1 parent 2b26573 commit 872660e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

internal/control_test_engine/gnb/ngap/handler.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,16 @@ func HandlerPduSessionResourceSetupRequest(gnb *context.GNBContext, message *nga
381381
log.Error("[GNB][NGAP] Error in Pdu Session Resource Setup Request.")
382382
log.Error("[GNB][NGAP] ", err)
383383

384+
// If PDU session already exists, retrieve it instead of failing
385+
existingSession, getErr := ue.GetPduSession(pduSessionId)
386+
if getErr == nil && existingSession != nil {
387+
log.Warn("[GNB][NGAP] PDU Session ", pduSessionId, " already exists, using existing session")
388+
pduSession = existingSession
389+
} else {
390+
// Cannot create or retrieve session, skip this item
391+
log.Error("[GNB][NGAP] Cannot create or retrieve PDU Session ", pduSessionId, ", skipping")
392+
continue
393+
}
384394
}
385395
configuredPduSessions = append(configuredPduSessions, pduSession)
386396

0 commit comments

Comments
 (0)