-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
gracefully shutdown master, pserver, fix gometalinter errors #3062
Conversation
// find the first id and write info | ||
pserverAddr := e.externalIP + ":" + strconv.Itoa(port) | ||
c.Put(psKey, pserverAddr, clientv3.WithLease(resp.ID)) | ||
c.Put(psKey, pserverAddr, clientv3.WithLease(e.sess.Lease())) |
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.
赞,使用session会简单很多~
@@ -39,6 +39,7 @@ type EtcdClient struct { | |||
statePath string | |||
client *clientv3.Client | |||
lock *concurrency.Mutex | |||
sess *concurrency.Session | |||
} | |||
|
|||
// NewEtcdClient creates a new EtcdClient. |
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.
Below "TODO" comments can be removed.
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.
Thanks! Done.
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++
There's a metalinter "shadow" check failed, please fix this to let CI pass.
@typhoonzero Thanks! Fixed. |
Fixes: #2599