Skip to content
Snippets Groups Projects
Commit 90dc862b authored by Jake Taylor's avatar Jake Taylor
Browse files

add comments

parent d07727c1
Branches
Tags
2 merge requests!231Revert "Update store to print changes to the partners list",!169Hotfix/renable historical
......@@ -462,10 +462,7 @@ func (h *HostPool) checkReplace(hostId *id.ID, hostErr error) (bool, error) {
}
h.hostMux.Unlock()
}
if err != nil {
return false, err
}
return doReplace, err
return doReplace && err != nil, err
}
// Select a viable HostPool candidate from the NDF
......
......@@ -64,6 +64,8 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error
proxies[proxy].GetId(), err)
continue
}
// Not retryable, now we must check whether the Host should be replaced
replaced, checkReplaceErr := s.checkReplace(proxies[proxy].GetId(), err)
if replaced {
jww.WARN.Printf("Unable to SendToAny, replaced a proxy %s with error %s",
......@@ -125,6 +127,8 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc,
targets[i], targetHosts[i].GetId(), err)
continue
}
// Not retryable, now we must check whether the Host should be replaced
replaced, checkReplaceErr := s.checkReplace(targetHosts[i].GetId(), err)
if replaced {
jww.WARN.Printf("Unable to SendToPreferred first pass via %s, replaced a proxy %s with error %s",
......@@ -194,6 +198,8 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc,
target, proxy, err)
continue
}
// Not retryable, now we must check whether the Host should be replaced
replaced, checkReplaceErr := s.checkReplace(proxy.GetId(), err)
badProxies[proxy.String()] = nil
if replaced {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment