Skip to content

v0.9.6 Fix incorrectly leave

Compare
Choose a tag to compare
@wubin1989 wubin1989 released this 19 Jan 16:22
· 790 commits to main since this release
  1. Remove mlist.Leave from registry.Shutdown method because calling leave method will send a left message to remote peers and make its state to be StateLeft. A node won't gossip messages to StateLeft nodes any more. If left a cluster incorrectly by calling leave method, the node won't have any chance to refute suspect or dead message to let remote peers know it still alive (or become alive again).
  2. Add another package level method for leaving cluster
// Leave leaves the cluster on purpose
func Leave(timeout time.Duration) {
	if mlist != nil {
		_ = mlist.Leave(timeout)
		logger.Info("local node left the cluster")
	}
}