From: rangajal Date: Fri, 31 Jan 2020 07:14:26 +0000 (+0000) Subject: Temporary Fix for R3 (E2M->E2T issue) - retrying when is_Ready flag in socket handle... X-Git-Tag: 0.4.15~10 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=d2563ed2763e3333e7ce94904a7bade4180d007f;p=ric-plt%2Frtmgr.git Temporary Fix for R3 (E2M->E2T issue) - retrying when is_Ready flag in socket handle is false Change-Id: I0838c8a80bd218e3b9f82679b923e7555f8f94e8 Signed-off-by: rangajal --- diff --git a/RELNOTES b/RELNOTES index 9371ae0..c9f5423 100644 --- a/RELNOTES +++ b/RELNOTES @@ -1,3 +1,6 @@ +### v0.4.10 +* Temporary Fix for R3 (E2M->E2T issue) - retrying when is_Ready flag in socket handle is false + ### v0.4.8 * Entry in meid map will only contain the delta change diff --git a/container-tag.yaml b/container-tag.yaml index 556f988..42ff158 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.4.9 +tag: 0.4.10 diff --git a/pkg/sbi/nngpush.go b/pkg/sbi/nngpush.go index 8438064..ac61c0b 100644 --- a/pkg/sbi/nngpush.go +++ b/pkg/sbi/nngpush.go @@ -36,6 +36,7 @@ import ( _ "nanomsg.org/go/mangos/v2/transport/all" "routing-manager/pkg/rtmgr" "strconv" + "time" ) type NngPush struct { @@ -129,14 +130,40 @@ func (c *NngPush) dial(ep *rtmgr.Endpoint) error { return nil } +/* +func (c *NngPush) DistributeAll(policies *[]string) error { + xapp.Logger.Debug("Invoked: sbi.DistributeAll") + xapp.Logger.Debug("args: %v", *policies) + for _, ep := range rtmgr.Eps { + if ep.IsReady { + go c.send(ep, policies) + } else { + xapp.Logger.Warn("Endpoint " + ep.Uuid + " is not ready") + } + } + } + return nil +} + +*/ + +/* + Temporary solution for R3 - E2M -> E2T issue +*/ func (c *NngPush) DistributeAll(policies *[]string) error { xapp.Logger.Debug("Invoked: sbi.DistributeAll") xapp.Logger.Debug("args: %v", *policies) for _, ep := range rtmgr.Eps { - if ep.IsReady { - go c.send(ep, policies) - } else { - xapp.Logger.Warn("Endpoint " + ep.Uuid + " is not ready") + i := 1 + for i< 5 { + if ep.IsReady { + go c.send(ep, policies) + break + } else { + xapp.Logger.Warn("Endpoint " + ep.Uuid + " is not ready" + " Retry count " + strconv.Itoa(i)) + time.Sleep(10 * time.Millisecond) + i++ + } } } return nil