Browse Source

Merge pull request #2099 from hashicorp/f-update-serf

Pulls in latest Serf to get flap metric.
pull/1796/merge
James Phillips 9 years ago
parent
commit
6d8f298269
  1. 9
      Godeps/Godeps.json
  2. 1
      vendor/github.com/hashicorp/serf/coordinate/README.md
  3. 2
      vendor/github.com/hashicorp/serf/coordinate/config.go
  4. 8
      vendor/github.com/hashicorp/serf/serf/config.go
  5. 5
      vendor/github.com/hashicorp/serf/serf/serf.go

9
Godeps/Godeps.json generated vendored

@ -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",

1
vendor/github.com/hashicorp/serf/coordinate/README.md generated vendored

@ -1 +0,0 @@
# TODO - I'll beef this up as I implement each of the enhancements.

2
vendor/github.com/hashicorp/serf/coordinate/config.go generated vendored

@ -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

8
vendor/github.com/hashicorp/serf/serf/config.go generated vendored

@ -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,

5
vendor/github.com/hashicorp/serf/serf/serf.go generated vendored

@ -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)

Loading…
Cancel
Save