VOL-2487 - correct meter state size calculation
Also:
- modified OF read loop to use bufio as opposed to custome buffered io
- cleaned up the OF client state machine processing, including more
logging
Change-Id: If16f57f6f30a6fe6fecab85b5bf638402f2b7693
diff --git a/internal/pkg/ofagent/refresh.go b/internal/pkg/ofagent/refresh.go
index 8f68ef0..9baed59 100644
--- a/internal/pkg/ofagent/refresh.go
+++ b/internal/pkg/ofagent/refresh.go
@@ -67,8 +67,7 @@
}
logger.Debugw("GrpcClient refreshDeviceList", log.Fields{"ToAdd": toAdd, "ToDel": toDel})
for i := 0; i < len(toAdd); i++ {
- var client = ofa.addOFClient(toAdd[i])
- go client.Run(context.Background())
+ ofa.addOFClient(toAdd[i]) // client is started in addOFClient
}
for i := 0; i < len(toDel); i++ {
ofa.clientMap[toDel[i]].Stop()
@@ -90,7 +89,6 @@
PacketOutChannel: ofa.packetOutChannel,
ConnectionMaxRetries: ofa.ConnectionMaxRetries,
ConnectionRetryDelay: ofa.ConnectionRetryDelay,
- KeepRunning: true,
})
go ofc.Run(context.Background())
ofa.clientMap[deviceID] = ofc