From a8bafda8b69213940342a32e47b1f46592ae71dd Mon Sep 17 00:00:00 2001 From: James Phillips Date: Tue, 7 Jun 2016 09:22:41 -0700 Subject: [PATCH] Pulls in latest Serf to get flap metric. --- Godeps/Godeps.json | 9 +++++---- vendor/github.com/hashicorp/serf/coordinate/README.md | 1 - vendor/github.com/hashicorp/serf/coordinate/config.go | 2 +- vendor/github.com/hashicorp/serf/serf/config.go | 8 ++++++++ vendor/github.com/hashicorp/serf/serf/serf.go | 5 +++++ 5 files changed, 19 insertions(+), 6 deletions(-) delete mode 100644 vendor/github.com/hashicorp/serf/coordinate/README.md diff --git a/Godeps/Godeps.json b/Godeps/Godeps.json index e2828e7a8c..1bf83dcf5e 100644 --- a/Godeps/Godeps.json +++ b/Godeps/Godeps.json @@ -1,6 +1,7 @@ { "ImportPath": "github.com/hashicorp/consul", "GoVersion": "go1.6", + "GodepVersion": "v74", "Deps": [ { "ImportPath": "github.com/DataDog/datadog-go/statsd", @@ -225,13 +226,13 @@ }, { "ImportPath": "github.com/hashicorp/serf/coordinate", - "Comment": "v0.7.0-12-ge4ec8cc", - "Rev": "e4ec8cc423bbe20d26584b96efbeb9102e16d05f" + "Comment": "v0.7.0-62-gb60a6d9", + "Rev": "b60a6d928fe726a588f79a1d500582507f9d79de" }, { "ImportPath": "github.com/hashicorp/serf/serf", - "Comment": "v0.7.0-12-ge4ec8cc", - "Rev": "e4ec8cc423bbe20d26584b96efbeb9102e16d05f" + "Comment": "v0.7.0-62-gb60a6d9", + "Rev": "b60a6d928fe726a588f79a1d500582507f9d79de" }, { "ImportPath": "github.com/hashicorp/yamux", diff --git a/vendor/github.com/hashicorp/serf/coordinate/README.md b/vendor/github.com/hashicorp/serf/coordinate/README.md deleted file mode 100644 index 0a96fd3eba..0000000000 --- a/vendor/github.com/hashicorp/serf/coordinate/README.md +++ /dev/null @@ -1 +0,0 @@ -# TODO - I'll beef this up as I implement each of the enhancements. \ No newline at end of file diff --git a/vendor/github.com/hashicorp/serf/coordinate/config.go b/vendor/github.com/hashicorp/serf/coordinate/config.go index a5b3aadfe4..b85a8ab7b0 100644 --- a/vendor/github.com/hashicorp/serf/coordinate/config.go +++ b/vendor/github.com/hashicorp/serf/coordinate/config.go @@ -16,7 +16,7 @@ package coordinate type Config struct { // The dimensionality of the coordinate system. As discussed in [2], more // dimensions improves the accuracy of the estimates up to a point. Per [2] - // we chose 4 dimensions plus a non-Euclidean height. + // we chose 8 dimensions plus a non-Euclidean height. Dimensionality uint // VivaldiErrorMax is the default error value when a node hasn't yet made diff --git a/vendor/github.com/hashicorp/serf/serf/config.go b/vendor/github.com/hashicorp/serf/serf/config.go index 87cba9f7ca..e8edd6902c 100644 --- a/vendor/github.com/hashicorp/serf/serf/config.go +++ b/vendor/github.com/hashicorp/serf/serf/config.go @@ -103,6 +103,13 @@ type Config struct { ReconnectTimeout time.Duration TombstoneTimeout time.Duration + // FlapTimeout is the amount of time less than which we consider a node + // being failed and rejoining looks like a flap for telemetry purposes. + // This should be set less than a typical reboot time, but large enough + // to see actual events, given our expected detection times for a failed + // node. + FlapTimeout time.Duration + // QueueDepthWarning is used to generate warning message if the // number of queued messages to broadcast exceeds this number. This // is to provide the user feedback if events are being triggered @@ -241,6 +248,7 @@ func DefaultConfig() *Config { QueueDepthWarning: 128, MaxQueueDepth: 4096, TombstoneTimeout: 24 * time.Hour, + FlapTimeout: 60 * time.Second, MemberlistConfig: memberlist.DefaultLANConfig(), QueryTimeoutMult: 16, QueryResponseSizeLimit: 1024, diff --git a/vendor/github.com/hashicorp/serf/serf/serf.go b/vendor/github.com/hashicorp/serf/serf/serf.go index 613b915dc4..78620d583e 100644 --- a/vendor/github.com/hashicorp/serf/serf/serf.go +++ b/vendor/github.com/hashicorp/serf/serf/serf.go @@ -871,6 +871,11 @@ func (s *Serf) handleNodeJoin(n *memberlist.Node) { s.members[n.Name] = member } else { oldStatus = member.Status + deadTime := time.Now().Sub(member.leaveTime) + if oldStatus == StatusFailed && deadTime < s.config.FlapTimeout { + metrics.IncrCounter([]string{"serf", "member", "flap"}, 1) + } + member.Status = StatusAlive member.leaveTime = time.Time{} member.Addr = net.IP(n.Addr)