From 006d3ab4d8a0f87f1428ab865f49d7ba823a504e Mon Sep 17 00:00:00 2001 From: matst80 Date: Fri, 22 Nov 2024 08:39:01 +0100 Subject: [PATCH] lock --- synced-pool.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/synced-pool.go b/synced-pool.go index 83ed3fb..860de7c 100644 --- a/synced-pool.go +++ b/synced-pool.go @@ -335,8 +335,8 @@ func (p *SyncedPool) Negotiate() { } func (p *SyncedPool) GetHealthyRemotes() []*RemoteHost { - // p.mu.RLock() - // defer p.mu.RUnlock() + p.mu.RLock() + defer p.mu.RUnlock() remotes := make([]*RemoteHost, 0, len(p.remotes)) for _, r := range p.remotes { if r.IsHealthy() { @@ -351,10 +351,7 @@ func (p *SyncedPool) RequestOwnership(id CartId) error { all := 0 for _, r := range p.GetHealthyRemotes() { - 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++ if err != nil {