only ask for confirmation if healthy
This commit is contained in:
@@ -107,7 +107,7 @@ func (p *SyncedPool) GrainOwnerChangeHandler(data []byte) (PoolMessage, []byte,
|
||||
host := idAndHostParts[1]
|
||||
log.Printf("Handling remote grain owner change to %s for id %s\n", host, id)
|
||||
for _, r := range p.remotes {
|
||||
if r.Host == host {
|
||||
if r.Host == host && r.IsHealthy() {
|
||||
// log.Printf("Remote grain %s changed to %s\n", id, host)
|
||||
|
||||
go p.SpawnRemoteGrain(id, host)
|
||||
@@ -324,6 +324,9 @@ func (p *SyncedPool) RequestOwnership(id CartId) error {
|
||||
all := 0
|
||||
p.mu.RLock()
|
||||
for _, r := range p.remotes {
|
||||
if !r.IsHealthy() {
|
||||
continue
|
||||
}
|
||||
log.Printf("Asking for confirmation change of %s to %s (me) with %s\n", id, p.Hostname, r.Host)
|
||||
err := r.ConfirmChange(id, p.Hostname)
|
||||
all++
|
||||
|
||||
Reference in New Issue
Block a user