-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
etcdctl/v3: add keepalive time/timeout #8663
Conversation
etcdctl/ctlv3/ctl.go
Outdated
@@ -51,6 +53,8 @@ func init() { | |||
|
|||
rootCmd.PersistentFlags().DurationVar(&globalFlags.DialTimeout, "dial-timeout", defaultDialTimeout, "dial timeout for client connections") | |||
rootCmd.PersistentFlags().DurationVar(&globalFlags.CommandTimeOut, "command-timeout", defaultCommandTimeOut, "timeout for short running command (excluding dial timeout)") | |||
rootCmd.PersistentFlags().DurationVar(&globalFlags.KeepAliveTime, "keep-alive-time", defaultKeepAliveTime, "keep alive time for client connections") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/keep-alive/keepalive/
and s/"keep alive/"keepalive/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I thought they are two words.
etcdctl/ctlv3/ctl.go
Outdated
@@ -51,6 +53,8 @@ func init() { | |||
|
|||
rootCmd.PersistentFlags().DurationVar(&globalFlags.DialTimeout, "dial-timeout", defaultDialTimeout, "dial timeout for client connections") | |||
rootCmd.PersistentFlags().DurationVar(&globalFlags.CommandTimeOut, "command-timeout", defaultCommandTimeOut, "timeout for short running command (excluding dial timeout)") | |||
rootCmd.PersistentFlags().DurationVar(&globalFlags.KeepAliveTime, "keep-alive-time", defaultKeepAliveTime, "keep alive time for client connections") | |||
rootCmd.PersistentFlags().DurationVar(&globalFlags.KeepAliveTimeout, "keep-alive-timeout", defaultKeepAliveTimeOut, "keep alive timeout for client connections") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/keep-alive/keepalive/
and s/"keep alive/"keepalive/
etcdctl/ctlv3/command/global.go
Outdated
@@ -207,6 +217,22 @@ func dialTimeoutFromCmd(cmd *cobra.Command) time.Duration { | |||
return dialTimeout | |||
} | |||
|
|||
func keepAliveTimeFromCmd(cmd *cobra.Command) time.Duration { | |||
keepAliveTime, err := cmd.Flags().GetDuration("keep-alive-time") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/keep-alive/keepalive/
etcdctl/ctlv3/command/global.go
Outdated
} | ||
|
||
func keepAliveTimeoutFromCmd(cmd *cobra.Command) time.Duration { | ||
keepAliveTimeout, err := cmd.Flags().GetDuration("keep-alive-timeout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/keep-alive/keepalive/
client can switch from fault node to normal when keep alive is timeout Fixes #7941
lgtm |
defer to @gyuho. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
etcdctl: add keep alive time/timeout in etcdctl
client can switch from fault node to normal when keep alive is timeout
Fixes #7941