add stream retry middleware for signalling (#1503)

This commit is contained in:
Paul Wells
2023-03-08 00:51:19 -08:00
committed by GitHub
parent 1f4fd6aafe
commit 2c93d55e5c
7 changed files with 50 additions and 20 deletions
+14 -1
View File
@@ -61,7 +61,7 @@ type Config struct {
KeyFile string `yaml:"key_file,omitempty"`
Keys map[string]string `yaml:"keys,omitempty"`
Region string `yaml:"region,omitempty"`
UsePSRPCSignal bool `yaml:"use_psrpc_signal,omitempty"`
SignalRelay SignalRelayConfig `yaml:"signal_relay,omitempty"`
// LogLevel is deprecated
LogLevel string `yaml:"log_level,omitempty"`
Logging LoggingConfig `yaml:"logging,omitempty"`
@@ -228,6 +228,13 @@ type NodeSelectorConfig struct {
Regions []RegionConfig `yaml:"regions"`
}
type SignalRelayConfig struct {
Enabled bool `yaml:"enabled"`
MaxAttempts int `yaml:"max_attempts"`
Timeout time.Duration `yaml:"timeout"`
Backoff time.Duration `yaml:"backoff"`
}
// RegionConfig lists available regions and their latitude/longitude, so the selector would prefer
// regions that are closer
type RegionConfig struct {
@@ -397,6 +404,12 @@ func NewConfig(confString string, strictMode bool, c *cli.Context, baseFlags []c
SysloadLimit: 0.9,
CPULoadLimit: 0.9,
},
SignalRelay: SignalRelayConfig{
Enabled: false,
MaxAttempts: 3,
Timeout: 500 * time.Millisecond,
Backoff: 500 * time.Millisecond,
},
Keys: map[string]string{},
}