etcd-io / zetcd

Serve the Apache Zookeeper API but back it with an etcd cluster
Apache License 2.0
1.09k stars 92 forks source link

revoke session when closing #110

Closed andrewhao888 closed 4 years ago

andrewhao888 commented 4 years ago

Looks like Conn, watches and id etcd.LeaseID of zetcd.session are resources that associate a particular zookeeper client. I am expecting all of them are closing together. However, Conn and watches close when the session.Close() is calling, and lease will be revoked after getting a CloseRequest from zookeeper client. When I am facing the edge case that zookeeper client power off or kill -9, there is no CloseRequest at all. The Session will keep the lease forever instead of revoking. So I am wondering, shall we revoke the lease during session closing?