leaderless gossip-based service discovery w/ consul compatibility
5

Configure Feed

Select the types of activity you want to include in your feed.

gofmt

Jes Olson (Feb 17, 2023, 9:51 PM -0800) 516210bc 5d051cf6

+8 -8
-1
agent.go
··· 37 37 return agent 38 38 } 39 39 40 - 41 40 func (a *Agent) eventLoop() { 42 41 serfShutdownCh := a.serf.ShutdownCh() 43 42 for {
+3 -3
config.go
··· 29 29 } 30 30 31 31 type Config struct { 32 - BindAddr string 33 - NodeName string 32 + BindAddr string 33 + NodeName string 34 34 StartJoin []string 35 - Services []Service 35 + Services []Service 36 36 } 37 37 38 38 // lifted from serf, could be simplified
+5 -4
main.go
··· 23 23 24 24 const ( 25 25 // gracefulTimeout controls how long we wait before forcefully terminating 26 - gracefulTimeout = 3 * time.Second 26 + // note that this value interacts with serfConfig.LeavePropagateDelay 27 + gracefulTimeout = 5 * time.Second 27 28 ) 28 29 29 30 func main() { ··· 139 140 // TODO: some of these serf settings were pulled 140 141 // from consul[1]. re-examine them eventually. 141 142 serfConfig.EnableNameConflictResolution = false 142 - serfConfig.ReconnectTimeout = 3 * 24 * time.Hour 143 - serfConfig.QueueDepthWarning = 1000000 144 - serfConfig.MinQueueDepth = 4096 145 143 serfConfig.LeavePropagateDelay = 3 * time.Second 144 + serfConfig.MinQueueDepth = 4096 145 + serfConfig.QueueDepthWarning = 1000000 146 + serfConfig.ReconnectTimeout = 3 * 24 * time.Hour 146 147 147 148 serfConfig.MemberlistConfig = memberlist.DefaultWANConfig() 148 149 serfConfig.MemberlistConfig.DeadNodeReclaimTime = 30 * time.Second