Fix for subscription fail handling 41/5641/1
authorAnssi Mannila <anssi.mannila@nokia.com>
Fri, 12 Feb 2021 09:56:20 +0000 (11:56 +0200)
committerAnssi Mannila <anssi.mannila@nokia.com>
Fri, 12 Feb 2021 09:56:51 +0000 (11:56 +0200)
Change-Id: Ibe601879ef5afcaf3b92e9798fb4da26bc035ed8
Signed-off-by: Anssi Mannila <anssi.mannila@nokia.com>
container-tag.yaml
pkg/control/control.go
pkg/control/sdl.go
pkg/control/ut_messaging_test.go

index 8420c21..48635a9 100644 (file)
@@ -2,4 +2,4 @@
 # By default this file is in the docker build directory,
 # but the location can configured in the JJB template.
 ---
-tag: "0.6.3"
+tag: "0.6.4"
index 182e06f..ac142eb 100755 (executable)
@@ -492,8 +492,7 @@ func (c *Control) handleSubscriptionCreate(subs *Subscription, parentTrans *Tran
                case *e2ap.E2APSubscriptionFailure:
                        removeSubscriptionFromDb = true
                        subRfMsg, valid = subs.SetCachedResponse(event, false)
-                       xapp.Logger.Info("SUBS-SubReq: internal delete  due event(%s) %s", typeofSubsMessage(event), idstring(nil, trans, subs, parentTrans))
-                       c.sendE2TSubscriptionDeleteRequest(subs, trans, parentTrans)
+                       xapp.Logger.Info("SUBS-SubReq: internal delete due event(%s) %s", typeofSubsMessage(event), idstring(nil, trans, subs, parentTrans))
                case *SubmgrRestartTestEvent:
                        // This simulates that no response has been received and after restart subscriptions are restored from db
                        xapp.Logger.Debug("Test restart flag is active. Dropping this transaction to test restart case")
index 0d7f845..ac8b8fb 100644 (file)
@@ -35,7 +35,6 @@ type SubscriptionInfo struct {
        EpList      xapp.RmrEndpointList
        SubReqMsg   e2ap.E2APSubscriptionRequest
        SubRespMsg  e2ap.E2APSubscriptionResponse
-       SubFailMsg  e2ap.E2APSubscriptionFailure
        SubRespRcvd string
 }
 
@@ -55,9 +54,6 @@ func (c *Control) WriteSubscriptionToSdl(subId uint32, subs *Subscription) error
        if typeofSubsMessage(subs.SubRFMsg) == "SubResp" {
                subscriptionInfo.SubRespRcvd = "SubResp"
                subscriptionInfo.SubRespMsg = *subs.SubRFMsg.(*e2ap.E2APSubscriptionResponse)
-       } else if typeofSubsMessage(subs.SubRFMsg) == "SubFail" {
-               subscriptionInfo.SubRespRcvd = "SubFail"
-               subscriptionInfo.SubFailMsg = *subs.SubRFMsg.(*e2ap.E2APSubscriptionFailure)
        } else {
                subscriptionInfo.SubRespRcvd = ""
        }
@@ -127,11 +123,6 @@ func (c *Control) CreateSubscription(subscriptionInfo *SubscriptionInfo, jsonSub
                subResp := e2ap.E2APSubscriptionResponse{}
                subResp = subscriptionInfo.SubRespMsg
                subs.SubRFMsg = &subResp
-       } else if subscriptionInfo.SubRespRcvd == "SubFail" {
-               subs.SubRespRcvd = false
-               subFail := e2ap.E2APSubscriptionFailure{}
-               subFail = subscriptionInfo.SubFailMsg
-               subs.SubRFMsg = &subFail
        } else {
                subs.SubRespRcvd = false
                subs.SubRFMsg = nil
index f4c7159..f3b8b8e 100644 (file)
@@ -1003,12 +1003,6 @@ func TestSubReqTwoRetriesNoRespAtAllInSubmgr(t *testing.T) {
 //     |              |      SubFail |
 //     |              |<-------------|
 //     |              |              |
-//     |              | SubDelReq    |
-//     |              |------------->|
-//     |              |              |
-//     |              |   SubDelResp |
-//     |              |<-------------|
-//     |              |              |
 //     |      SubFail |              |
 //     |<-------------|              |
 //     |              |              |
@@ -1022,8 +1016,6 @@ func TestSubReqSubFailRespInSubmgr(t *testing.T) {
                Counter{cSubReqFromXapp, 1},
                Counter{cSubReqToE2, 1},
                Counter{cSubFailFromE2, 1},
-               Counter{cSubDelReqToE2, 1},
-               Counter{cSubDelRespFromE2, 1},
                Counter{cSubFailToXapp, 1},
        })
 
@@ -1036,10 +1028,6 @@ func TestSubReqSubFailRespInSubmgr(t *testing.T) {
        fparams1.Set(crereq1)
        e2termConn1.SendSubsFail(t, fparams1, cremsg1)
 
-       // E2t: Receive SubsDelReq and send SubsDelResp (internal first)
-       delreq1, delmsg1 := e2termConn1.RecvSubsDelReq(t)
-       e2termConn1.SendSubsDelResp(t, delreq1, delmsg1)
-
        // Xapp: Receive SubsFail
        e2SubsId := xappConn1.RecvSubsFail(t, cretrans)
 
@@ -1451,11 +1439,6 @@ func TestSubReqAndSubDelOkSameActionParallel(t *testing.T) {
 //     |             |              |    SubFail1  |
 //     |             |              |<-------------|
 //     |             |              |              |
-//     |             |              | SubDelReq    |
-//     |             |              |------------->|
-//     |             |              |   SubDelResp |
-//     |             |              |<-------------|
-//     |             |              |              |
 //     |             |    SubFail1  |              |
 //     |             |<-------------|              |
 //     |             |              |              |
@@ -1486,10 +1469,6 @@ func TestSubReqAndSubDelNokSameActionParallel(t *testing.T) {
        fparams1.Set(crereq1)
        e2termConn1.SendSubsFail(t, fparams1, cremsg1)
 
-       // E2t: internal delete
-       delreq, delmsg := e2termConn1.RecvSubsDelReq(t)
-       e2termConn1.SendSubsDelResp(t, delreq, delmsg)
-
        //Fail1
        e2SubsId1 := xappConn1.RecvSubsFail(t, cretrans1)
        //Fail2