Revert "[VOL-4102] Adding exponential backoff to retry reconnection in case of a"
This reverts commit 66fbaf55ddb256bb84be1b907d4f12071bfac052.
Reason for revert: It should not be needed to try to reconnect the stream on a gRPC disconnect as the gRPC should be trying to reconnect under the hood. This needs more investigation but it's breaking the soft-reboot scenario so it's reverted for now.
Change-Id: I14d4b6f3a76d2feefe6e52f0736061de18d53206
diff --git a/VERSION b/VERSION
index 67e1183..73a1fbb 100644
--- a/VERSION
+++ b/VERSION
@@ -1,2 +1 @@
-3.4.0
-
+3.4.1-dev
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 47d2df0..bc88adf 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -57,7 +57,6 @@
defaultOmccEncryption = false
defaultEnableONUStats = false
defaultEnableGEMStats = false
- defaultReconnectTimeout = 1 * time.Minute
)
// AdapterFlags represents the set of configurations used by the read-write adaptercore service
@@ -91,7 +90,6 @@
OmccEncryption bool
EnableONUStats bool
EnableGEMStats bool
- ReconnectTimeout time.Duration
}
// NewAdapterFlags returns a new RWCore config
@@ -122,7 +120,6 @@
OmccEncryption: defaultOmccEncryption,
EnableONUStats: defaultEnableONUStats,
EnableGEMStats: defaultEnableGEMStats,
- ReconnectTimeout: defaultReconnectTimeout,
}
return &adapterFlags
}
@@ -208,9 +205,6 @@
help = fmt.Sprintf("Enable GEM Statistics")
flag.BoolVar(&(so.EnableGEMStats), "enable_gem_stats", defaultEnableGEMStats, help)
- help = fmt.Sprintf("Number of seconds for reconnection retries to a device")
- flag.DurationVar(&(so.ReconnectTimeout), "reconnection_timeout", defaultReconnectTimeout, help)
-
flag.Parse()
containerName := getContainerInfo()
if len(containerName) > 0 {
diff --git a/internal/pkg/core/device_handler.go b/internal/pkg/core/device_handler.go
index e81cd8f..9915268 100644
--- a/internal/pkg/core/device_handler.go
+++ b/internal/pkg/core/device_handler.go
@@ -430,26 +430,9 @@
log.Fields{"err": err,
"device-id": dh.device.Id})
}
- // if the connection drops we should retry to establish a new one for a little bit
- // for now set to 2 Minutes
- reconnectBackoff := backoff.NewExponentialBackOff()
- reconnectBackoff.MaxElapsedTime = dh.openOLT.ReconnectTimeout
- reconnectOperation := func() error {
- logger.Debugw(ctx, "attempting-reconnection-to-device",
- log.Fields{"err": err,
- "device-id": dh.device.Id})
- if indications, err = dh.startOpenOltIndicationStream(ctx); err != nil {
- return err
- }
- return nil
- }
- if err = backoff.Retry(reconnectOperation, reconnectBackoff); err != nil {
- logger.Errorw(ctx, "cannot-reconnect-to-device-backoff-expired",
- log.Fields{"err": err,
- "device-id": dh.device.Id})
+ if indications, err = dh.startOpenOltIndicationStream(ctx); err != nil {
return err
}
-
// once we re-initialized the indication stream, continue to read indications
continue
}
diff --git a/internal/pkg/core/device_handler_test.go b/internal/pkg/core/device_handler_test.go
index cc19c38..1cae8b6 100644
--- a/internal/pkg/core/device_handler_test.go
+++ b/internal/pkg/core/device_handler_test.go
@@ -1134,7 +1134,6 @@
}
func TestDeviceHandler_readIndications(t *testing.T) {
- t.Skip("Implement actual readIndications tests")
dh1 := newMockDeviceHandler()
dh2 := newMockDeviceHandler()
dh3 := newMockDeviceHandler()
diff --git a/internal/pkg/core/olt_state_transitions.go b/internal/pkg/core/olt_state_transitions.go
index c3d9ed2..e67bd43 100644
--- a/internal/pkg/core/olt_state_transitions.go
+++ b/internal/pkg/core/olt_state_transitions.go
@@ -41,17 +41,6 @@
deviceStateDown
)
-func (d DeviceState) String() string {
- names := [...]string{
- "deviceStateNull",
- "deviceStateInit",
- "deviceStateConnected",
- "deviceStateUp",
- "deviceStateDown",
- }
- return names[d]
-}
-
// Trigger for changing the state
type Trigger int
diff --git a/internal/pkg/core/openolt.go b/internal/pkg/core/openolt.go
index 1be2825..6564e29 100644
--- a/internal/pkg/core/openolt.go
+++ b/internal/pkg/core/openolt.go
@@ -54,7 +54,6 @@
lockDeviceHandlersMap sync.RWMutex
enableONUStats bool
enableGemStats bool
- ReconnectTimeout time.Duration
}
//NewOpenOLT returns a new instance of OpenOLT
@@ -79,7 +78,6 @@
openOLT.configManager = cm
openOLT.enableONUStats = cfg.EnableONUStats
openOLT.enableGemStats = cfg.EnableGEMStats
- openOLT.ReconnectTimeout = cfg.ReconnectTimeout
return &openOLT
}
diff --git a/internal/pkg/core/openolt_flowmgr.go b/internal/pkg/core/openolt_flowmgr.go
index 3cc00c7..eb35925 100644
--- a/internal/pkg/core/openolt_flowmgr.go
+++ b/internal/pkg/core/openolt_flowmgr.go
@@ -2136,10 +2136,7 @@
//RemoveFlow removes the flow from the device
func (f *OpenOltFlowMgr) RemoveFlow(ctx context.Context, flow *ofp.OfpFlowStats) error {
- logger.Infow(ctx, "removing-flow", log.Fields{
- "flow": *flow,
- "device-id": f.deviceHandler.device.Id,
- })
+ logger.Infow(ctx, "removing-flow", log.Fields{"flow": *flow})
var direction string
actionInfo := make(map[string]interface{})
@@ -2252,9 +2249,7 @@
logger.Infow(ctx, "adding-flow",
log.Fields{
"flow": flow,
- "flowmetadata": flowMetadata,
- "device-id": f.deviceHandler.device.Id,
- })
+ "flowmetadata": flowMetadata})
formulateClassifierInfoFromFlow(ctx, classifierInfo, flow)
err := formulateActionInfoFromFlow(ctx, actionInfo, classifierInfo, flow)