remove dead nodes
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
All checks were successful
Build and Publish / BuildAndDeploy (push) Successful in 1m52s
This commit is contained in:
@@ -127,11 +127,19 @@ func NewSyncedPool(local *GrainLocalPool, hostname string, d Discovery) (*Synced
|
|||||||
log.Printf("Error adding undiscovered remote %s: %v\n", h, err)
|
log.Printf("Error adding undiscovered remote %s: %v\n", h, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for _, r := range pool.remotes {
|
for i, r := range pool.remotes {
|
||||||
err := DoPing(r.connection)
|
err := DoPing(r.connection)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
r.MissedPings++
|
r.MissedPings++
|
||||||
log.Printf("Error pinging remote %s: %v\n, missed pings: %d", r.Host, err, r.MissedPings)
|
log.Printf("Error pinging remote %s: %v\n, missed pings: %d", r.Host, err, r.MissedPings)
|
||||||
|
if r.MissedPings > 3 {
|
||||||
|
log.Printf("Removing remote %s\n", r.Host)
|
||||||
|
|
||||||
|
pool.remotes = append(pool.remotes[:i], pool.remotes[i+1:]...)
|
||||||
|
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
r.MissedPings = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user