etcdctl(V3):reduce session timeout for lock command
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)
i suggest to reduce the timeout to less than 10s.
How about a --ttl flag so it's configurable?
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)
What other mechanism?
@heyitsanthony i agree with you if adding a flag to config the ttl, it can avoid the long waits when seesion expired and no other mechanism needed with a flag.
@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 related PR #8370 has been merged , the issue could be closed.
ok, thanks!