Skip to content
Snippets Groups Projects
Commit 4545d868 authored by Sydney Anne Erickson's avatar Sydney Anne Erickson :chipmunk:
Browse files

Merge branch 'release' into hotfix/clientErrorSource

parents 6e9ae8e2 a63c881b
No related branches found
No related tags found
1 merge request!23Release
...@@ -18,6 +18,7 @@ import ( ...@@ -18,6 +18,7 @@ import (
"gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/contact"
"gitlab.com/elixxir/primitives/states" "gitlab.com/elixxir/primitives/states"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/netTime"
"sync" "sync"
"time" "time"
) )
...@@ -229,9 +230,9 @@ func (c *Client) StopNetworkFollower(timeoutMS int) error { ...@@ -229,9 +230,9 @@ func (c *Client) StopNetworkFollower(timeoutMS int) error {
// WaitForNewtwork will block until either the network is healthy or the // WaitForNewtwork will block until either the network is healthy or the
// passed timeout. It will return true if the network is healthy // passed timeout. It will return true if the network is healthy
func (c *Client) WaitForNetwork(timeoutMS int) bool { func (c *Client) WaitForNetwork(timeoutMS int) bool {
start := time.Now() start := netTime.Now()
timeout := time.Duration(timeoutMS) * time.Millisecond timeout := time.Duration(timeoutMS) * time.Millisecond
for time.Now().Sub(start) < timeout { for netTime.Now().Sub(start) < timeout {
if c.api.GetHealth().IsHealthy() { if c.api.GetHealth().IsHealthy() {
return true return true
} }
......
...@@ -100,20 +100,17 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source, ...@@ -100,20 +100,17 @@ func (m *manager) follow(report interfaces.ClientErrorReport, rng csprng.Source,
jww.DEBUG.Printf("Executing poll for %v(%s) range: %s-%s(%s) from %s", jww.DEBUG.Printf("Executing poll for %v(%s) range: %s-%s(%s) from %s",
identity.EphId.Int64(), identity.Source, identity.StartRequest, identity.EphId.Int64(), identity.Source, identity.StartRequest,
identity.EndRequest, identity.EndRequest.Sub(identity.StartRequest), host.GetId()) identity.EndRequest, identity.EndRequest.Sub(identity.StartRequest), host.GetId())
result, err := comms.SendPoll(host, &pollReq) return comms.SendPoll(host, &pollReq)
})
if err != nil { if err != nil {
if report != nil { if report != nil {
report( report(
"NetworkFollower", "NetworkFollower",
fmt.Sprintf("Failed to poll network, \"%s\", Gateway: %s", err.Error(), host.String()), fmt.Sprintf("Failed to poll network, \"%s\":", err.Error()),
fmt.Sprintf("%+v", err), fmt.Sprintf("%+v", err),
) )
} }
jww.ERROR.Printf("Unable to poll %s for NDF: %+v", host, err) jww.ERROR.Printf("Unable to poll gateways: %+v", err)
}
return result, err
})
if err != nil {
return return
} }
......
...@@ -22,6 +22,7 @@ import ( ...@@ -22,6 +22,7 @@ import (
"gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"gitlab.com/xx_network/primitives/ndf" "gitlab.com/xx_network/primitives/ndf"
"golang.org/x/net/context"
"io" "io"
"math" "math"
"strings" "strings"
...@@ -30,7 +31,7 @@ import ( ...@@ -30,7 +31,7 @@ import (
) )
// List of errors that initiate a Host replacement // List of errors that initiate a Host replacement
var errorsList = []string{"context deadline exceeded", "connection refused", "host disconnected", var errorsList = []string{context.DeadlineExceeded.Error(), "connection refused", "host disconnected",
"transport is closing", "all SubConns are in TransientFailure", "Last try to connect", "transport is closing", "all SubConns are in TransientFailure", "Last try to connect",
ndf.NO_NDF, "Host is in cool down"} ndf.NO_NDF, "Host is in cool down"}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment