VOL-3433 Make timeouts of inter-adapter communication configurable
Change-Id: I3944737701546203262f95ffeb563716ff540c8a
diff --git a/internal/pkg/config/config.go b/internal/pkg/config/config.go
index 0e446a9..7d6c4e4 100644
--- a/internal/pkg/config/config.go
+++ b/internal/pkg/config/config.go
@@ -53,9 +53,10 @@
// defaultHearbeatFailReportInterval is the time adapter will wait before updating the state to the core.
defaultHearbeatFailReportInterval = 180 * time.Second
//defaultKafkaReconnectRetries -1: reconnect endlessly.
- defaultKafkaReconnectRetries = -1
- defaultCurrentReplica = 1
- defaultTotalReplicas = 1
+ defaultKafkaReconnectRetries = -1
+ defaultCurrentReplica = 1
+ defaultTotalReplicas = 1
+ defaultMaxTimeoutInterAdapterComm = 30 * time.Second
)
// AdapterFlags represents the set of configurations used by the read-write adaptercore service
@@ -87,6 +88,7 @@
KafkaReconnectRetries int
CurrentReplica int
TotalReplicas int
+ MaxTimeoutInterAdapterComm time.Duration
}
// NewAdapterFlags returns a new RWCore config
@@ -118,6 +120,7 @@
KafkaReconnectRetries: defaultKafkaReconnectRetries,
CurrentReplica: defaultCurrentReplica,
TotalReplicas: defaultTotalReplicas,
+ MaxTimeoutInterAdapterComm: defaultMaxTimeoutInterAdapterComm,
}
return &adapterFlags
}
@@ -200,6 +203,10 @@
help = "Total number of instances for this adapter"
flag.IntVar(&(so.TotalReplicas), "total_replica", defaultTotalReplicas, help)
+ help = fmt.Sprintf("Maximum Number of seconds for the default interadapter communication timeout")
+ flag.DurationVar(&(so.MaxTimeoutInterAdapterComm), "max_timeout_interadapter_comm",
+ defaultMaxTimeoutInterAdapterComm, help)
+
flag.Parse()
containerName := getContainerInfo()
if len(containerName) > 0 {