From 414ce3f09b4e92c28e0f3f65797a861c121b2a92 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 9 Jun 2021 17:11:53 -0400 Subject: [PATCH] Update serf To pick up data race fixes --- go.mod | 2 +- go.sum | 3 ++- vendor/github.com/hashicorp/serf/serf/serf.go | 7 ++++--- vendor/modules.txt | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index eb10c2ad20..994bb69e38 100644 --- a/go.mod +++ b/go.mod @@ -55,7 +55,7 @@ require ( github.com/hashicorp/raft v1.3.1 github.com/hashicorp/raft-autopilot v0.1.5 github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea - github.com/hashicorp/serf v0.9.5 + github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9 github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce github.com/imdario/mergo v0.3.6 diff --git a/go.sum b/go.sum index 672adbcf53..72f97a47e4 100644 --- a/go.sum +++ b/go.sum @@ -291,8 +291,9 @@ github.com/hashicorp/raft-autopilot v0.1.5 h1:onEfMH5uHVdXQqtas36zXUHEZxLdsJVu/n github.com/hashicorp/raft-autopilot v0.1.5/go.mod h1:Af4jZBwaNOI+tXfIqIdbcAnh/UyyqIMj/pOISIfhArw= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea h1:xykPFhrBAS2J0VBzVa5e80b5ZtYuNQtgXjN40qBZlD4= github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea/go.mod h1:pNv7Wc3ycL6F5oOWn+tPGo2gWD4a5X+yp/ntwdKLjRk= -github.com/hashicorp/serf v0.9.5 h1:EBWvyu9tcRszt3Bxp3KNssBMP1KuHWyO51lz9+786iM= github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9 h1:lCZfMBDn/Puwg9VosHMf/9p9jNDYYkbzVjb4jYjVfqU= +github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9/go.mod h1:qapjppkpNXHYTyzx+HqkyWGGkmUxafHjuspm/Bqb2Jc= github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086 h1:OKsyxKi2sNmqm1Gv93adf2AID2FOBFdCbbZn9fGtIdg= github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086/go.mod h1:R3Umvhlxi2TN7Ex2hzOowyeNb+SfbVWI973N+ctaFMk= github.com/hashicorp/vault/sdk v0.1.14-0.20200519221838-e0cfd64bc267 h1:e1ok06zGrWJW91rzRroyl5nRNqraaBe4d5hiKcVZuHM= diff --git a/vendor/github.com/hashicorp/serf/serf/serf.go b/vendor/github.com/hashicorp/serf/serf/serf.go index 8a7c069c2a..4f01fe0f61 100644 --- a/vendor/github.com/hashicorp/serf/serf/serf.go +++ b/vendor/github.com/hashicorp/serf/serf/serf.go @@ -958,7 +958,7 @@ func (s *Serf) handleNodeJoin(n *memberlist.Node) { member.Status = StatusAlive member.leaveTime = time.Time{} - member.Addr = net.IP(n.Addr) + member.Addr = n.Addr member.Port = n.Port member.Tags = s.decodeTags(n.Meta) } @@ -1088,6 +1088,7 @@ func (s *Serf) handleNodeUpdate(n *memberlist.Node) { // handleNodeLeaveIntent is called when an intent to leave is received. func (s *Serf) handleNodeLeaveIntent(leaveMsg *messageLeave) bool { + state := s.State() // Witness a potentially newer time s.clock.Witness(leaveMsg.LTime) @@ -1108,7 +1109,7 @@ func (s *Serf) handleNodeLeaveIntent(leaveMsg *messageLeave) bool { // Refute us leaving if we are in the alive state // Must be done in another goroutine since we have the memberLock - if leaveMsg.Node == s.config.NodeName && s.state == SerfAlive { + if leaveMsg.Node == s.config.NodeName && state == SerfAlive { s.logger.Printf("[DEBUG] serf: Refuting an older leave intent") go s.broadcastJoin(s.clock.Time()) return false @@ -1639,7 +1640,6 @@ func (s *Serf) reconnect() { // Select a random member to try and join idx := rand.Int31n(int32(n)) mem := s.failedMembers[idx] - s.memberLock.RUnlock() // Format the addr addr := net.UDPAddr{IP: mem.Addr, Port: int(mem.Port)} @@ -1649,6 +1649,7 @@ func (s *Serf) reconnect() { if mem.Name != "" { joinAddr = mem.Name + "/" + addr.String() } + s.memberLock.RUnlock() // Attempt to join at the memberlist level s.memberlist.Join([]string{joinAddr}) diff --git a/vendor/modules.txt b/vendor/modules.txt index b17354e9a7..68021ab115 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -489,7 +489,7 @@ github.com/hashicorp/raft github.com/hashicorp/raft-autopilot # github.com/hashicorp/raft-boltdb v0.0.0-20171010151810-6e5ba93211ea github.com/hashicorp/raft-boltdb -# github.com/hashicorp/serf v0.9.5 +# github.com/hashicorp/serf v0.9.6-0.20210609195804-2b5dd0cd2de9 github.com/hashicorp/serf/coordinate github.com/hashicorp/serf/serf # github.com/hashicorp/vault/api v1.0.5-0.20200717191844-f687267c8086