Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions memberlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,8 @@ func (m *Memberlist) Leave(timeout time.Duration) error {

m.nodeLock.Lock()
state, ok := m.nodeMap[m.config.Name]
incarnation := state.Incarnation
name := state.Name
m.nodeLock.Unlock()
if !ok {
m.logger.Printf("[WARN] memberlist: Leave but we're not in the node map.")
Expand All @@ -665,9 +667,9 @@ func (m *Memberlist) Leave(timeout time.Duration) error {
// intentionally. When Node equals From, other nodes know for
// sure this node is gone.
d := dead{
Incarnation: state.Incarnation,
Node: state.Name,
From: state.Name,
Incarnation: incarnation,
Node: name,
From: name,
}
m.deadNode(&d)

Expand Down