The flow and mcast handler channels should be unbuffered to make
them to be blocking
Change-Id: I847d59450b79caa09a7b5d1b8fa011a3561822a1
diff --git a/VERSION b/VERSION
index efe3085..6128b08 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.5.10
+3.5.11
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index f7d1405..85feaec 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -180,13 +180,13 @@
cloned := (proto.Clone(device)).(*voltha.Device)
dh.device = cloned
dh.openOLT = adapter
- dh.exitChannel = make(chan int, 1)
+ dh.exitChannel = make(chan int, 1) // TODO: Why buffered?
dh.lockDevice = sync.RWMutex{}
- dh.stopCollector = make(chan bool, 2)
- dh.stopHeartbeatCheck = make(chan bool, 2)
+ dh.stopCollector = make(chan bool, 2) // TODO: Why buffered?
+ dh.stopHeartbeatCheck = make(chan bool, 2) // TODO: Why buffered?
dh.metrics = pmmetrics.NewPmMetrics(cloned.Id, pmmetrics.Frequency(150), pmmetrics.FrequencyOverride(false), pmmetrics.Grouped(false), pmmetrics.Metrics(pmNames))
dh.activePorts = sync.Map{}
- dh.stopIndications = make(chan bool, 1)
+ dh.stopIndications = make(chan bool, 1) // TODO: Why buffered?
dh.perPonOnuIndicationChannel = make(map[uint32]onuIndicationChannels)
// Create a slice of buffered channels for handling concurrent mcast flow/group.
dh.incomingMcastFlowOrGroup = make([]chan McastFlowOrGroupControlBlock, MaxNumOfGroupHandlerChannels)
@@ -194,7 +194,7 @@
dh.mcastHandlerRoutineActive = make([]bool, MaxNumOfGroupHandlerChannels)
for i := range dh.incomingMcastFlowOrGroup {
dh.incomingMcastFlowOrGroup[i] = make(chan McastFlowOrGroupControlBlock, MaxNumOfGroupHandlerChannels)
- dh.stopMcastHandlerRoutine[i] = make(chan bool, 1)
+ dh.stopMcastHandlerRoutine[i] = make(chan bool)
// Spin up a go routine to handling incoming mcast flow/group (add/modify/remove).
// There will be MaxNumOfGroupHandlerChannels number of mcastFlowOrGroupChannelHandlerRoutine go routines.
// These routines will be blocked on the dh.incomingMcastFlowOrGroup[mcast-group-id modulo MaxNumOfGroupHandlerChannels] channel
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index b596412..26973ba 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -249,7 +249,7 @@
flowMgr.flowHandlerRoutineActive = make([]bool, MaxOnusPerPon+1)
for i := range flowMgr.incomingFlows {
flowMgr.incomingFlows[i] = make(chan flowControlBlock, maxConcurrentFlowsPerOnu)
- flowMgr.stopFlowHandlerRoutine[i] = make(chan bool, 1)
+ flowMgr.stopFlowHandlerRoutine[i] = make(chan bool)
// Spin up a go routine to handling incoming flows (add/remove).
// There will be on go routine per ONU.
// This routine will be blocked on the flowMgr.incomingFlows[onu-id] channel for incoming flows.