[VOL-4469] Onu adapter reconcilement may stuck on VLAN processing, especially in TT traffic scenarios
Signed-off-by: mpagenko <michael.pagenkopf@adtran.com>
Change-Id: If321388c67e2e52eb04b8a55167eb3c1c7575e5d
diff --git a/internal/pkg/mib/onu_device_entry.go b/internal/pkg/mib/onu_device_entry.go
index 61e852d..a6068ec 100755
--- a/internal/pkg/mib/onu_device_entry.go
+++ b/internal/pkg/mib/onu_device_entry.go
@@ -970,20 +970,26 @@
oo.SOnuPersistentData.PersActiveSwVersion = value
}
-// SetReconcilingFlows - TODO: add comment
-func (oo *OnuDeviceEntry) SetReconcilingFlows(value bool) {
+// setReconcilingFlows - TODO: add comment
+func (oo *OnuDeviceEntry) setReconcilingFlows(value bool) {
oo.mutexReconcilingFlowsFlag.Lock()
oo.reconcilingFlows = value
oo.mutexReconcilingFlowsFlag.Unlock()
}
-// SetChReconcilingFlowsFinished - TODO: add comment
-func (oo *OnuDeviceEntry) SetChReconcilingFlowsFinished(value bool) {
- oo.chReconcilingFlowsFinished <- value
+// SendChReconcilingFlowsFinished - TODO: add comment
+func (oo *OnuDeviceEntry) SendChReconcilingFlowsFinished(value bool) {
+ if oo != nil { //if the object still exists (might have been already deleted in background)
+ //use asynchronous channel sending to avoid stucking on non-waiting receiver
+ select {
+ case oo.chReconcilingFlowsFinished <- value:
+ default:
+ }
+ }
}
-// IsReconcilingFlows - TODO: add comment
-func (oo *OnuDeviceEntry) IsReconcilingFlows() bool {
+// isReconcilingFlows - TODO: add comment
+func (oo *OnuDeviceEntry) isReconcilingFlows() bool {
oo.mutexReconcilingFlowsFlag.RLock()
value := oo.reconcilingFlows
oo.mutexReconcilingFlowsFlag.RUnlock()