[VOL-4102] Adding exponential backoff to retry reconnection in case of a
gRPC connection drop to the device
Adding device-id to flow logs
Change-Id: Ia279743af6d052c5c9f1a5a62c3b183c82aab175
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index bc88adf..47d2df0 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -57,6 +57,7 @@
defaultOmccEncryption = false
defaultEnableONUStats = false
defaultEnableGEMStats = false
+ defaultReconnectTimeout = 1 * time.Minute
)
// AdapterFlags represents the set of configurations used by the read-write adaptercore service
@@ -90,6 +91,7 @@
OmccEncryption bool
EnableONUStats bool
EnableGEMStats bool
+ ReconnectTimeout time.Duration
}
// NewAdapterFlags returns a new RWCore config
@@ -120,6 +122,7 @@
OmccEncryption: defaultOmccEncryption,
EnableONUStats: defaultEnableONUStats,
EnableGEMStats: defaultEnableGEMStats,
+ ReconnectTimeout: defaultReconnectTimeout,
}
return &adapterFlags
}
@@ -205,6 +208,9 @@
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 {