-
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):reduce session timeout for lock command #8365
Comments
How about a
What other mechanism? |
@heyitsanthony |
@jiaxuanzhou do you want to work on this improvement? |
@xiang90 i can work on it ,will submit a patch soon. |
@jiaxuanzhou thanks! |
@xiang90 @heyitsanthony i found NewSession(client *v3.Client, opts ...SessionOption) is called by elect cmd too, need to add the flag as a gloabal role or just as a sub-flag used by lock ? |
@heyitsanthony |
ok, thanks! |
1,the default timeout of lock command is etcd\clientv3\concurrency\session.go:
defaultSessionTTL = 60
in the production scenario, when there is an unexpected server crash of the client side(container scenario: kill the docker), the client process can not capture the signal of the syscall, then the other clients must wait 60s to gain the lock, the timeout is too long in production environment, i suggest to reduce the timeout to less than 10s.
2, suggest add another mechanism to ensure the lock will be released immediately when the client process who holds the lock exited.
Currently code just capture two kind of syscall signals to inform the process to close the communication link:
signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM)
The text was updated successfully, but these errors were encountered: