Skip to content
Snippets Groups Projects
Commit 80d6fb9f authored by Jake Taylor's avatar Jake Taylor :lips:
Browse files

Merge branch 'hotfix/RenableHistorical' into 'release'

Hotfix/renable historical

See merge request !169
parents 91a75f0b f8266026
No related branches found
No related tags found
2 merge requests!231Revert "Update store to print changes to the partners list",!169Hotfix/renable historical
...@@ -462,7 +462,7 @@ func (h *HostPool) checkReplace(hostId *id.ID, hostErr error) (bool, error) { ...@@ -462,7 +462,7 @@ func (h *HostPool) checkReplace(hostId *id.ID, hostErr error) (bool, error) {
} }
h.hostMux.Unlock() h.hostMux.Unlock()
} }
return doReplace, err return doReplace && err == nil, err
} }
// Select a viable HostPool candidate from the NDF // Select a viable HostPool candidate from the NDF
......
...@@ -55,6 +55,7 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error ...@@ -55,6 +55,7 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error
// Retry of the proxy could not communicate // Retry of the proxy could not communicate
jww.INFO.Printf("Unable to SendToAny via %s: non-fatal error received, retrying: %s", jww.INFO.Printf("Unable to SendToAny via %s: non-fatal error received, retrying: %s",
proxies[proxy].GetId().String(), err) proxies[proxy].GetId().String(), err)
continue
} else if strings.Contains(err.Error(), "unable to connect to target host") || } else if strings.Contains(err.Error(), "unable to connect to target host") ||
strings.Contains(err.Error(), "unable to find target host") { strings.Contains(err.Error(), "unable to find target host") {
// Retry of the proxy could not communicate // Retry of the proxy could not communicate
...@@ -62,15 +63,21 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error ...@@ -62,15 +63,21 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error
" proxy could not contact requested host", " proxy could not contact requested host",
proxies[proxy].GetId(), err) proxies[proxy].GetId(), err)
continue continue
} else if replaced, checkReplaceErr := s.checkReplace(proxies[proxy].GetId(), err); replaced { }
if checkReplaceErr != nil {
// 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", jww.WARN.Printf("Unable to SendToAny, replaced a proxy %s with error %s",
proxies[proxy].GetId().String(), checkReplaceErr) proxies[proxy].GetId().String(), err.Error())
} else { } else {
jww.WARN.Printf("Unable to SendToAny, replaced a proxy %s", if checkReplaceErr != nil {
proxies[proxy].GetId().String()) jww.WARN.Printf("Unable to SendToAny via %s: %s. Unable to replace host: %+v",
} proxies[proxy].GetId().String(), err.Error(), checkReplaceErr)
} else { } else {
jww.WARN.Printf("Unable to SendToAny via %s: %s. Did not replace host.",
proxies[proxy].GetId().String(), err.Error())
}
return nil, errors.WithMessage(err, "Received error with SendToAny") return nil, errors.WithMessage(err, "Received error with SendToAny")
} }
} }
...@@ -111,6 +118,7 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc, ...@@ -111,6 +118,7 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc,
// Retry of the proxy could not communicate // Retry of the proxy could not communicate
jww.INFO.Printf("Unable to to SendToPreferred first pass %s via %s: non-fatal error received, retrying: %s", jww.INFO.Printf("Unable to to SendToPreferred first pass %s via %s: non-fatal error received, retrying: %s",
targets[i], targetHosts[i].GetId(), err) targets[i], targetHosts[i].GetId(), err)
continue
} else if strings.Contains(err.Error(), "unable to connect to target host") || } else if strings.Contains(err.Error(), "unable to connect to target host") ||
strings.Contains(err.Error(), "unable to find target host") { strings.Contains(err.Error(), "unable to find target host") {
// Retry of the proxy could not communicate // Retry of the proxy could not communicate
...@@ -118,22 +126,21 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc, ...@@ -118,22 +126,21 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc,
"proxy could not contact requested host", "proxy could not contact requested host",
targets[i], targetHosts[i].GetId(), err) targets[i], targetHosts[i].GetId(), err)
continue continue
} else if replaced, checkReplaceErr := s.checkReplace(targetHosts[i].GetId(), err); replaced { }
// 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",
targets[i], targetHosts[i].GetId(), err.Error())
} else {
if checkReplaceErr != nil { if checkReplaceErr != nil {
jww.WARN.Printf("Unable to SendToPreferred first pass %s via %s, "+ jww.WARN.Printf("Unable to SendToPreferred first pass %s via %s: %s. Unable to replace host: %+v",
"proxy failed, was replaced with error: %s", targets[i], targetHosts[i].GetId(), err.Error(), checkReplaceErr)
targets[i], targetHosts[i].GetId(), checkReplaceErr)
} else { } else {
jww.WARN.Printf("Unable to SendToPreferred first pass %s via %s, "+ jww.WARN.Printf("Unable to SendToPreferred first pass %s via %s: %s. Did not replace host.",
"proxy failed, was replaced", targets[i], targetHosts[i].GetId(), err.Error())
targets[i], targetHosts[i].GetId())
} }
jww.WARN.Printf("Unable to SendToPreferred first pass %s via %s: %s, proxy failed, was replaced",
targets[i], targetHosts[i].GetId(), checkReplaceErr)
continue
} else {
jww.WARN.Printf("Unable to SendToPreferred first pass %s via %s: %s, comm returned an error",
targets[i], targetHosts[i].GetId(), err)
return result, err return result, err
} }
} }
...@@ -182,6 +189,7 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc, ...@@ -182,6 +189,7 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc,
// Retry of the proxy could not communicate // Retry of the proxy could not communicate
jww.INFO.Printf("Unable to SendToPreferred second pass %s via %s: non-fatal error received, retrying: %s", jww.INFO.Printf("Unable to SendToPreferred second pass %s via %s: non-fatal error received, retrying: %s",
target, proxy, err) target, proxy, err)
continue
} else if strings.Contains(err.Error(), "unable to connect to target host") || } else if strings.Contains(err.Error(), "unable to connect to target host") ||
strings.Contains(err.Error(), "unable to find target host") { strings.Contains(err.Error(), "unable to find target host") {
// Retry of the proxy could not communicate // Retry of the proxy could not communicate
...@@ -189,21 +197,22 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc, ...@@ -189,21 +197,22 @@ func (s *Sender) SendToPreferred(targets []*id.ID, sendFunc sendToPreferredFunc,
" proxy could not contact requested host", " proxy could not contact requested host",
target, proxy, err) target, proxy, err)
continue continue
} else if replaced, checkReplaceErr := s.checkReplace(proxy.GetId(), err); replaced {
if checkReplaceErr != nil {
jww.WARN.Printf("Unable to SendToPreferred second pass %s via %s,"+
"proxy failed, was replaced with error: %s", target, proxy.GetId(),
checkReplaceErr)
} else {
jww.WARN.Printf("Unable to SendToPreferred second pass %s via %s, "+
"proxy failed, was replaced", target, proxy.GetId())
} }
// Not retryable, now we must check whether the Host should be replaced
replaced, checkReplaceErr := s.checkReplace(proxy.GetId(), err)
badProxies[proxy.String()] = nil badProxies[proxy.String()] = nil
continue if replaced {
jww.WARN.Printf("Unable to SendToPreferred second pass via %s, replaced a proxy %s with error %s",
target, proxy.GetId(), err.Error())
} else { } else {
jww.WARN.Printf("Unable to SendToPreferred second pass %s via %s: %s, comm returned an error", if checkReplaceErr != nil {
target, proxy.GetId(), err) jww.WARN.Printf("Unable to SendToPreferred second pass %s via %s: %s. Unable to replace host: %+v",
target, proxy.GetId(), err.Error(), checkReplaceErr)
} else {
jww.WARN.Printf("Unable to SendToPreferred second pass %s via %s: %s. Did not replace host.",
target, proxy.GetId(), err.Error())
}
return result, err return result, err
} }
} }
......
...@@ -56,11 +56,6 @@ func serializeRound(roundId id.Round) []byte { ...@@ -56,11 +56,6 @@ func serializeRound(roundId id.Round) []byte {
func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.IdentityUse) { func (m *Manager) GetMessagesFromRound(roundID id.Round, identity reception.IdentityUse) {
ri, err := m.Instance.GetRound(roundID) ri, err := m.Instance.GetRound(roundID)
if err != nil || m.params.ForceHistoricalRounds { if err != nil || m.params.ForceHistoricalRounds {
if m.params.RealtimeOnly {
jww.WARN.Printf("Skipping round %d because it is not in ram and we are realtime only mode",
roundID)
return
}
if m.params.ForceHistoricalRounds { if m.params.ForceHistoricalRounds {
jww.WARN.Printf("Forcing use of historical rounds for round ID %d.", jww.WARN.Printf("Forcing use of historical rounds for round ID %d.",
roundID) roundID)
......
...@@ -114,9 +114,8 @@ func (m *Manager) processTransmission(msg format.Message, ...@@ -114,9 +114,8 @@ func (m *Manager) processTransmission(msg format.Message,
c := NewContact(payload.GetRID(transmitMsg.GetPubKey(grp)), c := NewContact(payload.GetRID(transmitMsg.GetPubKey(grp)),
transmitMsg.GetPubKey(grp), dhKey, payload.GetTagFP(), payload.GetMaxParts()) transmitMsg.GetPubKey(grp), dhKey, payload.GetTagFP(), payload.GetMaxParts())
jww.INFO.Printf("Generated by singe use receiver reception id for single use: %s, "+ jww.INFO.Printf("Generated by singe use receiver reception id for single use. EphId %s, PubKey: %x",
"ephId: %v, pubkey: %x", c.partner, transmitMsg.GetPubKey(grp).Bytes())
c.partner, "unknown:", transmitMsg.GetPubKey(grp).Bytes())
return payload.GetContents(), c, nil return payload.GetContents(), c, nil
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment