Merge pull request #12702 from hexfusion/add-so

*: add support for socket options
This commit is contained in:
Gyuho Lee
2021-03-09 09:02:24 -08:00
committed by GitHub
17 changed files with 463 additions and 51 deletions

View File

@@ -232,6 +232,9 @@ type Config struct {
// before closing a non-responsive connection. 0 to disable.
GRPCKeepAliveTimeout time.Duration `json:"grpc-keepalive-timeout"`
// SocketOpts are socket options passed to listener config.
SocketOpts transport.SocketOpts
// PreVote is true to enable Raft Pre-Vote.
// If enabled, Raft runs an additional election phase
// to check whether it would get enough votes to win
@@ -400,6 +403,8 @@ func NewConfig() *Config {
GRPCKeepAliveInterval: DefaultGRPCKeepAliveInterval,
GRPCKeepAliveTimeout: DefaultGRPCKeepAliveTimeout,
SocketOpts: transport.SocketOpts{},
TickMs: 100,
ElectionMs: 1000,
InitialElectionTickAdvance: true,