Skip to content
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

Merged
merged 1 commit into from
Oct 9, 2017
Merged

etcdctl/v3: add keepalive time/timeout #8663

merged 1 commit into from
Oct 9, 2017

Conversation

xiaoyulei
Copy link
Contributor

etcdctl: add keep alive time/timeout in etcdctl

client can switch from fault node to normal when keep alive is timeout

Fixes #7941

@@ -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")
Copy link
Contributor

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/

Copy link
Contributor Author

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.

@@ -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")
Copy link
Contributor

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/

@@ -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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/keep-alive/keepalive/

}

func keepAliveTimeoutFromCmd(cmd *cobra.Command) time.Duration {
keepAliveTimeout, err := cmd.Flags().GetDuration("keep-alive-timeout")
Copy link
Contributor

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
@xiang90
Copy link
Contributor

xiang90 commented Oct 9, 2017

lgtm

@xiang90
Copy link
Contributor

xiang90 commented Oct 9, 2017

defer to @gyuho.

Copy link
Contributor

@gyuho gyuho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gyuho gyuho changed the title etcdctl: add keep alive time/timeout in etcdctl etcdctl/v3: add keep alive time/timeout in etcdctl Oct 9, 2017
@gyuho gyuho changed the title etcdctl/v3: add keep alive time/timeout in etcdctl etcdctl/v3: add keep alive time/timeout Oct 9, 2017
@xiang90 xiang90 merged commit 6571829 into etcd-io:master Oct 9, 2017
@gyuho gyuho changed the title etcdctl/v3: add keep alive time/timeout etcdctl/v3: add keepalive time/timeout Oct 9, 2017
@xiaoyulei xiaoyulei deleted the add_keepalive_for_ctlv3 branch October 10, 2017 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants