only ask for confirmation if healthy
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m20s

This commit is contained in:
matst80
2024-11-13 09:02:57 +01:00
parent 3615d2d7d1
commit 95720ededd

View File

@@ -107,7 +107,7 @@ func (p *SyncedPool) GrainOwnerChangeHandler(data []byte) (PoolMessage, []byte,
host := idAndHostParts[1] host := idAndHostParts[1]
log.Printf("Handling remote grain owner change to %s for id %s\n", host, id) log.Printf("Handling remote grain owner change to %s for id %s\n", host, id)
for _, r := range p.remotes { 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) // log.Printf("Remote grain %s changed to %s\n", id, host)
go p.SpawnRemoteGrain(id, host) go p.SpawnRemoteGrain(id, host)
@@ -324,6 +324,9 @@ func (p *SyncedPool) RequestOwnership(id CartId) error {
all := 0 all := 0
p.mu.RLock() p.mu.RLock()
for _, r := range p.remotes { 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) 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) err := r.ConfirmChange(id, p.Hostname)
all++ all++