kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 1 | /* |
| 2 | ================================================================================== |
| 3 | Copyright (c) 2019 AT&T Intellectual Property. |
| 4 | Copyright (c) 2019 Nokia |
| 5 | |
| 6 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | you may not use this file except in compliance with the License. |
| 8 | You may obtain a copy of the License at |
| 9 | |
| 10 | http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | |
| 12 | Unless required by applicable law or agreed to in writing, software |
| 13 | distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | See the License for the specific language governing permissions and |
| 16 | limitations under the License. |
| 17 | ================================================================================== |
| 18 | */ |
| 19 | |
| 20 | package control |
| 21 | |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 22 | import ( |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 23 | "errors" |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 24 | rtmgrclient "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client" |
| 25 | rtmgrhandle "gerrit.o-ran-sc.org/r/ric-plt/submgr/pkg/rtmgr_client/handle" |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 26 | "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp" |
| 27 | httptransport "github.com/go-openapi/runtime/client" |
| 28 | "github.com/go-openapi/strfmt" |
| 29 | "github.com/spf13/viper" |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 30 | "math/rand" |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 31 | "sync" |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 32 | "time" |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 33 | ) |
| 34 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 35 | var subReqTime time.Duration = 5 * time.Second |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 36 | var subDelReqTime time.Duration = 5 * time.Second |
| 37 | var maxSubReqTryCount uint64 = 2 // Initial try + retry |
| 38 | var maxSubDelReqTryCount uint64 = 2 // Initial try + retry |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 39 | |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 40 | type Control struct { |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 41 | e2ap *E2ap |
| 42 | registry *Registry |
| 43 | rtmgrClient *RtmgrClient |
| 44 | tracker *Tracker |
| 45 | timerMap *TimerMap |
| 46 | rmrSendMutex sync.Mutex |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 47 | msgCounter uint64 |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | type RMRMeid struct { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 51 | PlmnID string |
| 52 | EnbID string |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 53 | RanName string |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 54 | } |
| 55 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 56 | var seedSN uint16 |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 57 | |
| 58 | const ( |
| 59 | CREATE Action = 0 |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 60 | MERGE Action = 1 |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 61 | NONE Action = 2 |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 62 | DELETE Action = 3 |
| 63 | ) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 64 | |
| 65 | func init() { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 66 | xapp.Logger.Info("SUBMGR") |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 67 | viper.AutomaticEnv() |
| 68 | viper.SetEnvPrefix("submgr") |
| 69 | viper.AllowEmptyEnv(true) |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 70 | seedSN = uint16(viper.GetInt("seed_sn")) |
| 71 | if seedSN == 0 { |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 72 | rand.Seed(time.Now().UnixNano()) |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 73 | seedSN = uint16(rand.Intn(65535)) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 74 | } |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 75 | if seedSN > 65535 { |
| 76 | seedSN = 0 |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 77 | } |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 78 | xapp.Logger.Info("SUBMGR: Initial Sequence Number: %v", seedSN) |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 79 | } |
| 80 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 81 | func NewControl() *Control { |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 82 | registry := new(Registry) |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 83 | registry.Initialize(seedSN) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 84 | |
Balint Uveges | e9608cd | 2019-09-20 18:00:32 +0000 | [diff] [blame] | 85 | tracker := new(Tracker) |
| 86 | tracker.Init() |
| 87 | |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 88 | timerMap := new(TimerMap) |
| 89 | timerMap.Init() |
| 90 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 91 | transport := httptransport.New(viper.GetString("rtmgr.HostAddr")+":"+viper.GetString("rtmgr.port"), viper.GetString("rtmgr.baseUrl"), []string{"http"}) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 92 | client := rtmgrclient.New(transport, strfmt.Default) |
| 93 | handle := rtmgrhandle.NewProvideXappSubscriptionHandleParamsWithTimeout(10 * time.Second) |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 94 | deleteHandle := rtmgrhandle.NewDeleteXappSubscriptionHandleParamsWithTimeout(10 * time.Second) |
| 95 | rtmgrClient := RtmgrClient{client, handle, deleteHandle} |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 96 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 97 | return &Control{e2ap: new(E2ap), |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 98 | registry: registry, |
| 99 | rtmgrClient: &rtmgrClient, |
| 100 | tracker: tracker, |
| 101 | timerMap: timerMap, |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 102 | msgCounter: 0, |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 103 | } |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 104 | } |
| 105 | |
| 106 | func (c *Control) Run() { |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 107 | xapp.Run(c) |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 108 | } |
| 109 | |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 110 | func (c *Control) rmrSend(params *xapp.RMRParams) (err error) { |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 111 | status := false |
| 112 | i := 1 |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 113 | for ; i <= 10 && status == false; i++ { |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 114 | c.rmrSendMutex.Lock() |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 115 | status = xapp.Rmr.Send(params, false) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 116 | c.rmrSendMutex.Unlock() |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 117 | if status == false { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 118 | xapp.Logger.Info("rmr.Send() failed. Retry count %v, Mtype: %v, SubId: %v, Xid %s", i, params.Mtype, params.SubId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 119 | time.Sleep(500 * time.Millisecond) |
| 120 | } |
| 121 | } |
| 122 | if status == false { |
| 123 | err = errors.New("rmr.Send() failed") |
| 124 | xapp.Rmr.Free(params.Mbuf) |
| 125 | } |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 126 | return |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 127 | } |
| 128 | |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 129 | func (c *Control) rmrReplyToSender(params *xapp.RMRParams) (err error) { |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 130 | c.rmrSend(params) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 131 | return |
| 132 | } |
| 133 | |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 134 | func (c *Control) Consume(msg *xapp.RMRParams) (err error) { |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 135 | c.msgCounter++ |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 136 | switch msg.Mtype { |
| 137 | case xapp.RICMessageTypes["RIC_SUB_REQ"]: |
| 138 | go c.handleSubscriptionRequest(msg) |
| 139 | case xapp.RICMessageTypes["RIC_SUB_RESP"]: |
| 140 | go c.handleSubscriptionResponse(msg) |
| 141 | case xapp.RICMessageTypes["RIC_SUB_FAILURE"]: |
| 142 | go c.handleSubscriptionFailure(msg) |
| 143 | case xapp.RICMessageTypes["RIC_SUB_DEL_REQ"]: |
| 144 | go c.handleSubscriptionDeleteRequest(msg) |
| 145 | case xapp.RICMessageTypes["RIC_SUB_DEL_RESP"]: |
| 146 | go c.handleSubscriptionDeleteResponse(msg) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 147 | case xapp.RICMessageTypes["RIC_SUB_DEL_FAILURE"]: |
| 148 | go c.handleSubscriptionDeleteFailure(msg) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 149 | default: |
| 150 | xapp.Logger.Info("Unknown Message Type '%d', discarding", msg.Mtype) |
Balint Uveges | cd3881b | 2019-10-02 15:01:43 +0000 | [diff] [blame] | 151 | } |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 152 | return nil |
Balint Uveges | cd3881b | 2019-10-02 15:01:43 +0000 | [diff] [blame] | 153 | } |
| 154 | |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 155 | func (c *Control) handleSubscriptionRequest(params *xapp.RMRParams) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 156 | xapp.Logger.Info("SubReq received from Src: %s, Mtype: %v, SubId: %v, Xid: %s, Meid: %v", params.Src, params.Mtype, params.SubId, params.Xid, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 157 | xapp.Rmr.Free(params.Mbuf) |
| 158 | params.Mbuf = nil |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 159 | |
| 160 | /* Reserve a sequence number and set it in the payload */ |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 161 | subs := c.registry.ReserveSubscription() |
| 162 | if subs == nil { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 163 | xapp.Logger.Error("SubReq: Failed to reserve sequence number. Dropping this msg. SubId: %v, Xid: %s", params.SubId, params.Xid) |
| 164 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 165 | } |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 166 | |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 167 | params.SubId = int(subs.Seq) |
| 168 | err := c.e2ap.SetSubscriptionRequestSequenceNumber(params.Payload, subs.Seq) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 169 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 170 | xapp.Logger.Error("SubReq: Unable to get Sequence Number from Payload. Dropping this msg. Err: %v, SubId: %v, Xid: %s, Payload %X", err, params.SubId, params.Xid, params.Payload) |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 171 | c.registry.releaseSequenceNumber(subs.Seq) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 172 | return |
| 173 | } |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 174 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 175 | srcAddr, srcPort, err := c.rtmgrClient.SplitSource(params.Src) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 176 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 177 | xapp.Logger.Error("SubReq: Failed to update routing-manager. Dropping this msg. Err: %s, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 178 | c.registry.releaseSequenceNumber(subs.Seq) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 179 | return |
| 180 | } |
| 181 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 182 | // Create transatcion record for every subscription request |
| 183 | var forwardRespToXapp bool = true |
| 184 | var responseReceived bool = false |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 185 | transaction, err := c.tracker.TrackTransaction(subs.Seq, CREATE, *srcAddr, *srcPort, params, responseReceived, forwardRespToXapp) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 186 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 187 | xapp.Logger.Error("SubReq: Failed to create transaction record. Dropping this msg. Err: %v SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 188 | c.registry.releaseSequenceNumber(subs.Seq) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 189 | return |
| 190 | } |
| 191 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 192 | // Update routing manager about the new subscription |
Juha Hyttinen | 379ff08 | 2019-12-30 15:49:41 +0200 | [diff] [blame] | 193 | subRouteAction := transaction.SubRouteInfo() |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 194 | xapp.Logger.Info("SubReq: Starting routing manager update. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 195 | |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 196 | err = c.rtmgrClient.SubscriptionRequestUpdate(subRouteAction) |
| 197 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 198 | xapp.Logger.Error("SubReq: Failed to update routing manager. Dropping this msg. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 199 | c.registry.releaseSequenceNumber(subs.Seq) |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 200 | return |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 201 | } |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 202 | |
| 203 | // Setting new subscription ID in the RMR header |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 204 | xapp.Logger.Info("SubReq: Forwarding SubReq to E2T: Mtype: %v, SubId: %v, Xid %s, Meid %v", params.Mtype, params.SubId, params.Xid, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 205 | err = c.rmrSend(params) |
| 206 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 207 | xapp.Logger.Error("SubReq: Failed to send request to E2T %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 208 | } |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 209 | c.timerMap.StartTimer("RIC_SUB_REQ", int(subs.Seq), subReqTime, FirstTry, c.handleSubscriptionRequestTimer) |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 210 | xapp.Logger.Debug("SubReq: Debugging transaction table = %v", c.tracker.transactionTable) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 211 | return |
kalnagy | 4511475 | 2019-06-18 14:40:39 +0200 | [diff] [blame] | 212 | } |
| 213 | |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 214 | func (c *Control) handleSubscriptionResponse(params *xapp.RMRParams) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 215 | xapp.Logger.Info("SubResp received from Src: %s, Mtype: %v, SubId: %v, Meid: %v", params.Src, params.Mtype, params.SubId, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 216 | xapp.Rmr.Free(params.Mbuf) |
| 217 | params.Mbuf = nil |
| 218 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 219 | payloadSeqNum, err := c.e2ap.GetSubscriptionResponseSequenceNumber(params.Payload) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 220 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 221 | xapp.Logger.Error("SubResp: Unable to get Sequence Number from Payload. Dropping this msg. Err: %v, SubId: %v, Xid: %s, Payload %X", err, params.SubId, params.Xid, params.Payload) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 222 | return |
| 223 | } |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 224 | xapp.Logger.Info("SubResp: Received payloadSeqNum: %v", payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 225 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 226 | if !c.registry.IsValidSequenceNumber(payloadSeqNum) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 227 | xapp.Logger.Error("SubResp: Unknown payloadSeqNum. Dropping this msg. PayloadSeqNum: %v, SubId: %v", payloadSeqNum, params.SubId) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 228 | return |
| 229 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 230 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 231 | c.timerMap.StopTimer("RIC_SUB_REQ", int(payloadSeqNum)) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 232 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 233 | transaction, responseReceived, err := c.tracker.CheckResponseReceived(payloadSeqNum, CREATE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 234 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 235 | xapp.Logger.Info("SubResp: Dropping this msg. Err: %v SubId: %v", err, payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 236 | return |
| 237 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 238 | |
| 239 | if responseReceived == true { |
| 240 | // Subscription timer already received |
| 241 | return |
| 242 | } |
| 243 | xapp.Logger.Info("SubResp: SubId: %v, from address: %v:%v.", payloadSeqNum, transaction.Xappkey.Addr, transaction.Xappkey.Port) |
| 244 | |
| 245 | c.registry.setSubscriptionToConfirmed(payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 246 | |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 247 | params.SubId = int(payloadSeqNum) |
| 248 | params.Xid = transaction.OrigParams.Xid |
| 249 | |
| 250 | xapp.Logger.Info("SubResp: Forwarding Subscription Response to xApp Mtype: %v, SubId: %v, Meid: %v", params.Mtype, params.SubId, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 251 | err = c.rmrReplyToSender(params) |
| 252 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 253 | xapp.Logger.Error("SubResp: Failed to send response to xApp. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 254 | } |
| 255 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 256 | xapp.Logger.Info("SubResp: SubId: %v, from address: %v:%v. Deleting transaction record", payloadSeqNum, transaction.Xappkey.Addr, transaction.Xappkey.Port) |
| 257 | _, err = c.tracker.completeTransaction(payloadSeqNum, CREATE) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 258 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 259 | xapp.Logger.Error("SubResp: Failed to delete transaction record. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 260 | return |
| 261 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 262 | return |
| 263 | } |
| 264 | |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 265 | func (c *Control) handleSubscriptionFailure(params *xapp.RMRParams) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 266 | xapp.Logger.Info("SubFail received from Src: %s, Mtype: %v, SubId: %v, Meid: %v", params.Src, params.Mtype, params.SubId, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 267 | xapp.Rmr.Free(params.Mbuf) |
| 268 | params.Mbuf = nil |
| 269 | |
| 270 | payloadSeqNum, err := c.e2ap.GetSubscriptionFailureSequenceNumber(params.Payload) |
| 271 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 272 | xapp.Logger.Error("SubFail: Unable to get Sequence Number from Payload. Dropping this msg. Err: %v, SubId: %v, Xid: %s, Payload %X", err, params.SubId, params.Xid, params.Payload) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 273 | return |
| 274 | } |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 275 | xapp.Logger.Info("SubFail: Received payloadSeqNum: %v", payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 276 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 277 | c.timerMap.StopTimer("RIC_SUB_REQ", int(payloadSeqNum)) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 278 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 279 | transaction, responseReceived, err := c.tracker.CheckResponseReceived(payloadSeqNum, CREATE) |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 280 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 281 | xapp.Logger.Info("SubFail: Dropping this msg. Err: %v SubId: %v", err, payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 282 | return |
| 283 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 284 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 285 | if responseReceived == true { |
| 286 | // Subscription timer already received |
| 287 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 288 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 289 | xapp.Logger.Info("SubFail: SubId: %v, from address: %v:%v. Forwarding response to xApp", payloadSeqNum, transaction.Xappkey.Addr, transaction.Xappkey.Port) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 290 | |
| 291 | time.Sleep(3 * time.Second) |
| 292 | |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 293 | xapp.Logger.Info("SubFail: Starting routing manager update. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Juha Hyttinen | 379ff08 | 2019-12-30 15:49:41 +0200 | [diff] [blame] | 294 | subRouteAction := transaction.SubRouteInfo() |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 295 | err = c.rtmgrClient.SubscriptionRequestUpdate(subRouteAction) |
| 296 | if err != nil { |
| 297 | xapp.Logger.Error("SubFail: Failed to update routing manager. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 298 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 299 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 300 | xapp.Logger.Info("SubFail: Deleting transaction record. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 301 | if c.registry.releaseSequenceNumber(payloadSeqNum) { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 302 | _, err = c.tracker.completeTransaction(payloadSeqNum, CREATE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 303 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 304 | xapp.Logger.Error("SubFail: Failed to delete transaction record. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 305 | return |
| 306 | } |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 307 | } else { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 308 | xapp.Logger.Error("SubFail: Failed to release sequency number. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 309 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 310 | } |
| 311 | return |
| 312 | } |
| 313 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 314 | func (c *Control) handleSubscriptionRequestTimer(strId string, nbrId int, tryCount uint64) { |
| 315 | subId := uint16(nbrId) |
| 316 | xapp.Logger.Info("handleSubTimer: SubReq timer expired. subId: %v, tryCount: %v", subId, tryCount) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 317 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 318 | transaction, responseReceived, err := c.tracker.CheckResponseReceived(subId, CREATE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 319 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 320 | xapp.Logger.Info("handleSubTimer: Dropping this timer action. Err: %v SubId: %v", err, subId) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 321 | return |
| 322 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 323 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 324 | if responseReceived == true { |
| 325 | // Subscription Response or Failure already received |
| 326 | return |
| 327 | } |
| 328 | |
| 329 | if tryCount < maxSubReqTryCount { |
| 330 | xapp.Logger.Info("handleSubTimer: Resending SubReq to E2T: Mtype: %v, SubId: %v, Xid %s, Meid %v", transaction.OrigParams.Mtype, transaction.OrigParams.SubId, transaction.OrigParams.Xid, transaction.OrigParams.Meid) |
| 331 | // Set possible to handle new response for the subId |
| 332 | err = c.tracker.RetryTransaction(subId, CREATE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 333 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 334 | xapp.Logger.Error("handleSubDelTimer: Failed to retry transaction record. Dropping timer action. Err %v, SubId: %v", err, transaction.OrigParams.SubId) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 335 | return |
| 336 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 337 | |
| 338 | err = c.rmrSend(transaction.OrigParams) |
| 339 | if err != nil { |
| 340 | xapp.Logger.Error("handleSubTimer: Failed to send request to E2T %v, SubId: %v, Xid: %s", err, transaction.OrigParams.SubId, transaction.OrigParams.Xid) |
| 341 | } |
| 342 | |
| 343 | tryCount++ |
| 344 | c.timerMap.StartTimer("RIC_SUB_REQ", int(subId), subReqTime, tryCount, c.handleSubscriptionRequestTimer) |
| 345 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 346 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 347 | |
| 348 | var subDelReqPayload []byte |
| 349 | subDelReqPayload, err = c.e2ap.PackSubscriptionDeleteRequest(transaction.OrigParams.Payload, subId) |
| 350 | if err != nil { |
| 351 | xapp.Logger.Error("handleSubTimer: Packing SubDelReq failed. Err: %v", err) |
| 352 | return |
| 353 | } |
| 354 | |
| 355 | // Cancel failed subscription |
| 356 | var params xapp.RMRParams |
| 357 | params.Mtype = 12020 // RIC SUBSCRIPTION DELETE |
| 358 | params.SubId = int(subId) |
| 359 | params.Xid = transaction.OrigParams.Xid |
| 360 | params.Meid = transaction.OrigParams.Meid |
| 361 | params.Src = transaction.OrigParams.Src |
| 362 | params.PayloadLen = len(subDelReqPayload) |
| 363 | params.Payload = subDelReqPayload |
| 364 | params.Mbuf = nil |
| 365 | |
| 366 | // Delete CREATE transaction |
| 367 | _, err = c.tracker.completeTransaction(subId, CREATE) |
| 368 | if err != nil { |
| 369 | xapp.Logger.Error("handleSubTimer: Failed to delete create transaction record. Dropping this timer action. Err: %v, SubId: %v, Xid: %s", err, subId, params.Xid) |
| 370 | return |
| 371 | } |
| 372 | |
| 373 | // Create DELETE transaction |
| 374 | var forwardRespToXapp bool = false |
| 375 | _, err = c.trackDeleteTransaction(¶ms, subId, forwardRespToXapp) |
| 376 | if err != nil { |
| 377 | xapp.Logger.Error("handleSubTimer: Failed to create delete transaction record. Dropping this timer action. Err: %v, SubId: %v, Xid: %s", err, subId, params.Xid) |
| 378 | return |
| 379 | } |
| 380 | |
| 381 | xapp.Logger.Info("handleSubTimer: Sending SubDelReq to E2T: Mtype: %v, SubId: %v, Meid: %v", params.Mtype, params.SubId, params.Meid) |
| 382 | c.rmrSend(¶ms) |
| 383 | if err != nil { |
| 384 | xapp.Logger.Error("handleSubTimer: Failed to send request to E2T %v. SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
| 385 | } |
| 386 | c.timerMap.StartTimer("RIC_SUB_DEL_REQ", int(subId), subDelReqTime, FirstTry, c.handleSubscriptionDeleteRequestTimer) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 387 | return |
| 388 | } |
| 389 | |
| 390 | func (act Action) String() string { |
| 391 | actions := [...]string{ |
| 392 | "CREATE", |
| 393 | "MERGE", |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 394 | "NONE", |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 395 | "DELETE", |
| 396 | } |
| 397 | |
| 398 | if act < CREATE || act > DELETE { |
| 399 | return "Unknown" |
| 400 | } |
| 401 | return actions[act] |
| 402 | } |
| 403 | |
| 404 | func (act Action) valid() bool { |
| 405 | switch act { |
| 406 | case CREATE, MERGE, DELETE: |
| 407 | return true |
| 408 | default: |
| 409 | return false |
| 410 | } |
| 411 | } |
| 412 | |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 413 | func (c *Control) handleSubscriptionDeleteRequest(params *xapp.RMRParams) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 414 | xapp.Logger.Info("SubDelReq received from Src: %s, Mtype: %v, SubId: %v, Xid: %s, Meid: %v", params.Src, params.Mtype, params.SubId, params.Xid, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 415 | xapp.Rmr.Free(params.Mbuf) |
| 416 | params.Mbuf = nil |
| 417 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 418 | payloadSeqNum, err := c.e2ap.GetSubscriptionDeleteRequestSequenceNumber(params.Payload) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 419 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 420 | xapp.Logger.Error("SubDelReq: Unable to get Sequence Number from Payload. Dropping this msg. Err: %v, SubId: %v, Xid: %s, Payload %X", err, params.SubId, params.Xid, params.Payload) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 421 | return |
| 422 | } |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 423 | xapp.Logger.Info("SubDelReq: Received payloadSeqNum: %v", payloadSeqNum) |
| 424 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 425 | if c.registry.IsValidSequenceNumber(payloadSeqNum) { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 426 | var forwardRespToXapp bool = true |
| 427 | _, err = c.trackDeleteTransaction(params, payloadSeqNum, forwardRespToXapp) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 428 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 429 | xapp.Logger.Error("SubDelReq: Failed to create transaction record. Dropping this msg. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 430 | return |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 431 | } |
Juha Hyttinen | 47b842b | 2020-01-08 13:01:52 +0200 | [diff] [blame] | 432 | c.registry.setSubscriptionToUnConfirmed(payloadSeqNum) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 433 | } else { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 434 | xapp.Logger.Error("SubDelReq: Not valid sequence number. Dropping this msg. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 435 | return |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 436 | } |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 437 | |
| 438 | xapp.Logger.Info("SubDelReq: Forwarding Request to E2T. Mtype: %v, SubId: %v, Xid: %s, Meid: %v", params.Mtype, params.SubId, params.Xid, params.Meid) |
kalnagy | 93cc3e2 | 2019-09-19 11:29:29 +0200 | [diff] [blame] | 439 | c.rmrSend(params) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 440 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 441 | xapp.Logger.Error("SubDelReq: Failed to send request to E2T. Err %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 442 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 443 | c.timerMap.StartTimer("RIC_SUB_DEL_REQ", int(payloadSeqNum), subDelReqTime, FirstTry, c.handleSubscriptionDeleteRequestTimer) |
Peter Szilagyi | fbc56f9 | 2019-07-23 19:29:46 +0000 | [diff] [blame] | 444 | return |
| 445 | } |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 446 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 447 | func (c *Control) trackDeleteTransaction(params *xapp.RMRParams, payloadSeqNum uint16, forwardRespToXapp bool) (transaction *Transaction, err error) { |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 448 | srcAddr, srcPort, err := c.rtmgrClient.SplitSource(params.Src) |
| 449 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 450 | xapp.Logger.Error("Failed to split source address. Err: %s, SubId: %v, Xid: %s", err, payloadSeqNum, params.Xid) |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 451 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 452 | var respReceived bool = false |
| 453 | transaction, err = c.tracker.TrackTransaction(payloadSeqNum, DELETE, *srcAddr, *srcPort, params, respReceived, forwardRespToXapp) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 454 | return |
| 455 | } |
| 456 | |
| 457 | func (c *Control) handleSubscriptionDeleteResponse(params *xapp.RMRParams) (err error) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 458 | xapp.Logger.Info("SubDelResp received from Src: %s, Mtype: %v, SubId: %v, Meid: %v", params.Src, params.Mtype, params.SubId, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 459 | xapp.Rmr.Free(params.Mbuf) |
| 460 | params.Mbuf = nil |
| 461 | |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 462 | payloadSeqNum, err := c.e2ap.GetSubscriptionDeleteResponseSequenceNumber(params.Payload) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 463 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 464 | xapp.Logger.Error("SubDelResp: Unable to get Sequence Number from Payload. Dropping this msg. Err: %v, SubId: %v, Xid: %s, Payload %X", err, params.SubId, params.Xid, params.Payload) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 465 | return |
| 466 | } |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 467 | xapp.Logger.Info("SubDelResp: Received payloadSeqNum: %v", payloadSeqNum) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 468 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 469 | c.timerMap.StopTimer("RIC_SUB_DEL_REQ", int(payloadSeqNum)) |
| 470 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 471 | transaction, responseReceived, err := c.tracker.CheckResponseReceived(payloadSeqNum, DELETE) |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 472 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 473 | xapp.Logger.Info("SubDelResp: Dropping this msg. Err: %v SubId: %v", err, payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 474 | return |
| 475 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 476 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 477 | if responseReceived == true { |
| 478 | // Subscription Delete timer already received |
| 479 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 480 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 481 | xapp.Logger.Info("SubDelResp: SubId: %v, from address: %v:%v. Forwarding response to xApp", payloadSeqNum, transaction.Xappkey.Addr, transaction.Xappkey.Port) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 482 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 483 | if transaction.ForwardRespToXapp == true { |
| 484 | params.SubId = int(payloadSeqNum) |
| 485 | params.Xid = transaction.OrigParams.Xid |
| 486 | xapp.Logger.Info("Forwarding SubDelResp to xApp: Mtype: %v, SubId: %v, Xid: %v, Meid: %v", params.Mtype, params.SubId, params.Xid, params.Meid) |
| 487 | err = c.rmrReplyToSender(params) |
| 488 | if err != nil { |
| 489 | xapp.Logger.Error("SubDelResp: Failed to send response to xApp. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
| 490 | } |
| 491 | |
| 492 | time.Sleep(3 * time.Second) |
| 493 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 494 | |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 495 | xapp.Logger.Info("SubDelResp: Starting routing manager update. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Juha Hyttinen | 379ff08 | 2019-12-30 15:49:41 +0200 | [diff] [blame] | 496 | subRouteAction := SubRouteInfo{DELETE, transaction.Xappkey.Addr, transaction.Xappkey.Port, payloadSeqNum} |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 497 | err = c.rtmgrClient.SubscriptionRequestUpdate(subRouteAction) |
| 498 | if err != nil { |
| 499 | xapp.Logger.Error("SubDelResp: Failed to update routing manager. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
| 500 | return |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 501 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 502 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 503 | xapp.Logger.Info("SubDelResp: Deleting transaction record. SubId: %v, Xid: %s", params.SubId, params.Xid) |
kalnagy | 1455c85 | 2019-10-21 13:06:23 +0200 | [diff] [blame] | 504 | if c.registry.releaseSequenceNumber(payloadSeqNum) { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 505 | _, err = c.tracker.completeTransaction(payloadSeqNum, DELETE) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 506 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 507 | xapp.Logger.Error("SubDelResp: Failed to delete transaction record. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 508 | return |
| 509 | } |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 510 | } else { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 511 | xapp.Logger.Error("SubDelResp: Failed to release sequency number. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 512 | return |
kalnagy | e001868 | 2019-09-26 16:28:25 +0200 | [diff] [blame] | 513 | } |
| 514 | return |
| 515 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 516 | |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 517 | func (c *Control) handleSubscriptionDeleteFailure(params *xapp.RMRParams) { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 518 | xapp.Logger.Info("SubDelFail received from Src: %s, Mtype: %v, SubId: %v, Meid: %v", params.Src, params.Mtype, params.SubId, params.Meid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 519 | xapp.Rmr.Free(params.Mbuf) |
| 520 | params.Mbuf = nil |
| 521 | |
| 522 | payloadSeqNum, err := c.e2ap.GetSubscriptionDeleteFailureSequenceNumber(params.Payload) |
| 523 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 524 | xapp.Logger.Error("SubDelFail: Unable to get Sequence Number from Payload. Dropping this msg. Err: %v, SubId: %v, Xid: %s, Payload %X", err, params.SubId, params.Xid, params.Payload) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 525 | return |
| 526 | } |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 527 | xapp.Logger.Info("SubDelFail: Received payloadSeqNum: %v", payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 528 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 529 | c.timerMap.StopTimer("RIC_SUB_DEL_REQ", int(payloadSeqNum)) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 530 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 531 | transaction, responseReceived, err := c.tracker.CheckResponseReceived(payloadSeqNum, DELETE) |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 532 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 533 | xapp.Logger.Info("SubDelFail: Dropping this msg. Err: %v SubId: %v", err, payloadSeqNum) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 534 | return |
| 535 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 536 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 537 | if responseReceived == true { |
| 538 | // Subscription Delete timer already received |
| 539 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 540 | } |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 541 | xapp.Logger.Info("SubDelFail: SubId: %v, from address: %v:%v. Forwarding response to xApp", payloadSeqNum, transaction.Xappkey.Addr, transaction.Xappkey.Port) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 542 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 543 | if transaction.ForwardRespToXapp == true { |
| 544 | var subDelRespPayload []byte |
| 545 | subDelRespPayload, err = c.e2ap.PackSubscriptionDeleteResponse(transaction.OrigParams.Payload, payloadSeqNum) |
| 546 | if err != nil { |
| 547 | xapp.Logger.Error("SubDelFail:Packing SubDelResp failed. Err: %v", err) |
| 548 | return |
| 549 | } |
| 550 | |
| 551 | params.Mtype = 12021 // RIC SUBSCRIPTION DELETE RESPONSE |
| 552 | params.SubId = int(payloadSeqNum) |
| 553 | params.Xid = transaction.OrigParams.Xid |
| 554 | params.Meid = transaction.OrigParams.Meid |
| 555 | params.Src = transaction.OrigParams.Src |
| 556 | params.PayloadLen = len(subDelRespPayload) |
| 557 | params.Payload = subDelRespPayload |
| 558 | params.Mbuf = nil |
| 559 | xapp.Logger.Info("SubDelFail: Forwarding SubDelFail to xApp: Mtype: %v, SubId: %v, Xid: %v, Meid: %v", params.Mtype, params.SubId, params.Xid, params.Meid) |
| 560 | err = c.rmrReplyToSender(params) |
| 561 | if err != nil { |
| 562 | xapp.Logger.Error("SubDelFail: Failed to send SubDelFail to xApp. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
| 563 | } |
| 564 | |
| 565 | time.Sleep(3 * time.Second) |
| 566 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 567 | |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 568 | xapp.Logger.Info("SubDelFail: Starting routing manager update. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Juha Hyttinen | 379ff08 | 2019-12-30 15:49:41 +0200 | [diff] [blame] | 569 | subRouteAction := SubRouteInfo{DELETE, transaction.Xappkey.Addr, transaction.Xappkey.Port, payloadSeqNum} |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 570 | err = c.rtmgrClient.SubscriptionRequestUpdate(subRouteAction) |
Juha Hyttinen | c65f5b0 | 2019-12-30 14:24:04 +0200 | [diff] [blame] | 571 | if err != nil { |
| 572 | xapp.Logger.Error("SubDelFail: Failed to update routing manager. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
| 573 | return |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 574 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 575 | |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 576 | xapp.Logger.Info("SubDelFail: Deleting transaction record. SubId: %v, Xid: %s", params.SubId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 577 | if c.registry.releaseSequenceNumber(payloadSeqNum) { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 578 | _, err = c.tracker.completeTransaction(payloadSeqNum, DELETE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 579 | if err != nil { |
Anssi Mannila | 26c922a | 2019-12-17 11:18:08 +0200 | [diff] [blame] | 580 | xapp.Logger.Error("SubDelFail: Failed to delete transaction record. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 581 | return |
| 582 | } |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 583 | } else { |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 584 | xapp.Logger.Error("SubDelFail: Failed to release sequency number. Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
Anssi Mannila | 90fa021 | 2019-12-12 10:47:47 +0200 | [diff] [blame] | 585 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 586 | } |
| 587 | return |
| 588 | } |
| 589 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 590 | func (c *Control) handleSubscriptionDeleteRequestTimer(strId string, nbrId int, tryCount uint64) { |
| 591 | subId := uint16(nbrId) |
| 592 | xapp.Logger.Info("handleSubDelTimer: SubDelReq timer expired. subId: %v, tryCount: %v", subId, tryCount) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 593 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 594 | transaction, responseReceived, err := c.tracker.CheckResponseReceived(subId, DELETE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 595 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 596 | xapp.Logger.Info("handleSubTimer: Dropping this timer action. Err: %v SubId: %v", err, subId) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 597 | return |
| 598 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 599 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 600 | if responseReceived == true { |
| 601 | // Subscription Delete Response or Failure already received |
| 602 | return |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 603 | } |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 604 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 605 | if tryCount < maxSubDelReqTryCount { |
| 606 | xapp.Logger.Info("handleSubDelTimer: Resending SubDelReq to E2T: Mtype: %v, SubId: %v, Xid %s, Meid %v", transaction.OrigParams.Mtype, transaction.OrigParams.SubId, transaction.OrigParams.Xid, transaction.OrigParams.Meid) |
| 607 | // Set possible to handle new response for the subId |
| 608 | err = c.tracker.RetryTransaction(subId, DELETE) |
| 609 | if err != nil { |
| 610 | xapp.Logger.Error("handleSubDelTimer: Failed to retry transaction record. Dropping timer action. Err %v, SubId: %v", err, transaction.OrigParams.SubId) |
| 611 | return |
| 612 | } |
Juha Hyttinen | ff8dccd | 2019-12-10 14:34:07 +0200 | [diff] [blame] | 613 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 614 | err = c.rmrSend(transaction.OrigParams) |
| 615 | if err != nil { |
| 616 | xapp.Logger.Error("handleSubDelTimer: Failed to send request to E2T %v, SubId: %v, Xid: %s", err, transaction.OrigParams.SubId, transaction.OrigParams.Xid) |
| 617 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 618 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 619 | tryCount++ |
| 620 | c.timerMap.StartTimer("RIC_SUB_DEL_REQ", int(subId), subReqTime, tryCount, c.handleSubscriptionDeleteRequestTimer) |
| 621 | return |
| 622 | } |
| 623 | |
| 624 | var params xapp.RMRParams |
| 625 | if transaction.ForwardRespToXapp == true { |
| 626 | var subDelRespPayload []byte |
| 627 | subDelRespPayload, err = c.e2ap.PackSubscriptionDeleteResponse(transaction.OrigParams.Payload, subId) |
| 628 | if err != nil { |
| 629 | xapp.Logger.Error("handleSubDelTimer: Unable to pack payload. Dropping this timer action. Err: %v, SubId: %v, Xid: %s, Payload %x", err, subId, transaction.OrigParams.Xid, transaction.OrigParams.Payload) |
| 630 | return |
| 631 | } |
| 632 | |
| 633 | params.Mtype = 12021 // RIC SUBSCRIPTION DELETE RESPONSE |
| 634 | params.SubId = int(subId) |
| 635 | params.Meid = transaction.OrigParams.Meid |
| 636 | params.Xid = transaction.OrigParams.Xid |
| 637 | params.Src = transaction.OrigParams.Src |
| 638 | params.PayloadLen = len(subDelRespPayload) |
| 639 | params.Payload = subDelRespPayload |
| 640 | params.Mbuf = nil |
| 641 | |
| 642 | xapp.Logger.Info("handleSubDelTimer: Sending SubDelResp to xApp: Mtype: %v, SubId: %v, Xid: %s, Meid: %v", params.Mtype, params.SubId, params.Xid, params.Meid) |
| 643 | err = c.rmrReplyToSender(¶ms) |
| 644 | if err != nil { |
| 645 | xapp.Logger.Error("handleSubDelTimer: Failed to send response to xApp: Err: %v, SubId: %v, Xid: %s", err, params.SubId, params.Xid) |
| 646 | } |
| 647 | |
| 648 | time.Sleep(3 * time.Second) |
| 649 | } |
| 650 | |
| 651 | xapp.Logger.Info("handleSubDelTimer: Starting routing manager update. SubId: %v, Xid: %s", subId, params.Xid) |
Juha Hyttinen | 379ff08 | 2019-12-30 15:49:41 +0200 | [diff] [blame] | 652 | subRouteAction := SubRouteInfo{DELETE, transaction.Xappkey.Addr, transaction.Xappkey.Port, subId} |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 653 | err = c.rtmgrClient.SubscriptionRequestUpdate(subRouteAction) |
| 654 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 655 | xapp.Logger.Error("handleSubDelTimer: Failed to update routing manager. Err: %v, SubId: %v, Xid: %s", err, subId, params.Xid) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 656 | return |
| 657 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 658 | |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 659 | xapp.Logger.Info("handleSubDelTimer: Deleting transaction record. SubId: %v, Xid: %s", subId, params.Xid) |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 660 | if c.registry.releaseSequenceNumber(subId) { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 661 | _, err = c.tracker.completeTransaction(subId, DELETE) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 662 | if err != nil { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 663 | xapp.Logger.Error("handleSubDelTimer: Failed to delete transaction record. Err: %v, SubId: %v, Xid: %s", err, subId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 664 | return |
| 665 | } |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 666 | } else { |
Anssi Mannila | 8046c70 | 2020-01-02 13:39:05 +0200 | [diff] [blame] | 667 | xapp.Logger.Error("handleSubDelTimer: Failed to release sequency number. SubId: %v, Xid: %s", subId, params.Xid) |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 668 | } |
Anssi Mannila | 2e99e2f | 2019-12-05 13:57:06 +0200 | [diff] [blame] | 669 | return |
Anssi Mannila | f1d0eb6 | 2019-12-17 15:29:55 +0200 | [diff] [blame] | 670 | } |