X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=pkg%2Fcontrol%2Fe2if_state.go;fp=pkg%2Fcontrol%2Fe2if_state.go;h=5f7eb353360fdab9b050f2b047ed3c6054644948;hb=fc67b036d8944c372715b7306f892d2ddfb4684f;hp=b86ef81fc90594c9d41f7e7ce7808ef0326048b8;hpb=52e2f8ec3ebcb9d58fe2b01d70530f2fa44666cb;p=ric-plt%2Fsubmgr.git diff --git a/pkg/control/e2if_state.go b/pkg/control/e2if_state.go index b86ef81..5f7eb35 100644 --- a/pkg/control/e2if_state.go +++ b/pkg/control/e2if_state.go @@ -22,9 +22,10 @@ package control import ( "encoding/json" "fmt" - "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" "strings" "sync" + + "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" ) type XappRnibIf struct { @@ -117,6 +118,18 @@ func (e *E2IfState) NotificationCb(ch string, events ...string) { delete(e.NbIdMap, nbId) e.control.registry.DeleteAllE2Subscriptions(nbId, e.control) } + } else if strings.Contains(events[0], "_UNDER_RESET") { + xapp.Logger.Debug("NotificationCb UNDER_RESET len(nbId) == 0 ") + e.control.UpdateCounter(cE2StateUnderReset) + nbId, err := ExtractNbiIdFromString(events[0]) + if err != nil { + xapp.Logger.Error("NotificationCb _UNDER_RESET %v ", err) + return + } + xapp.Logger.Debug("E2 Under Reset. NbId=%s", nbId) + if _, ok := e.NbIdMap[nbId]; ok { + e.control.registry.DeleteAllE2Subscriptions(nbId, e.control) + } } } @@ -197,6 +210,9 @@ func ExtractNbiIdFromString(s string) (string, error) { } else if strings.Contains(s, "_DISCONNECTED") { splitStringTbl := strings.Split(s, "_DISCONNECTED") nbId = splitStringTbl[0] + } else if strings.Contains(s, "_UNDER_RESET") { + splitStringTbl := strings.Split(s, "_UNDER_RESET") + nbId = splitStringTbl[0] } if len(nbId) == 0 { return "", fmt.Errorf("ExtractNbiIdFromString(): len(nbId) == 0 ")