From ebaeae67034fe1168d6014bd5c1739d4e09923c0 Mon Sep 17 00:00:00 2001 From: Anssi Mannila Date: Fri, 12 Feb 2021 11:56:20 +0200 Subject: [PATCH] Fix for subscription fail handling Change-Id: Ibe601879ef5afcaf3b92e9798fb4da26bc035ed8 Signed-off-by: Anssi Mannila --- container-tag.yaml | 2 +- pkg/control/control.go | 3 +-- pkg/control/sdl.go | 9 --------- pkg/control/ut_messaging_test.go | 21 --------------------- 4 files changed, 2 insertions(+), 33 deletions(-) diff --git a/container-tag.yaml b/container-tag.yaml index 8420c21..48635a9 100644 --- a/container-tag.yaml +++ b/container-tag.yaml @@ -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" diff --git a/pkg/control/control.go b/pkg/control/control.go index 182e06f..ac142eb 100755 --- a/pkg/control/control.go +++ b/pkg/control/control.go @@ -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") diff --git a/pkg/control/sdl.go b/pkg/control/sdl.go index 0d7f845..ac8b8fb 100644 --- a/pkg/control/sdl.go +++ b/pkg/control/sdl.go @@ -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 diff --git a/pkg/control/ut_messaging_test.go b/pkg/control/ut_messaging_test.go index f4c7159..f3b8b8e 100644 --- a/pkg/control/ut_messaging_test.go +++ b/pkg/control/ut_messaging_test.go @@ -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 -- 2.16.6