Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
4545d868
Commit
4545d868
authored
4 years ago
by
Sydney Anne Erickson
Browse files
Options
Downloads
Plain Diff
Merge branch 'release' into hotfix/clientErrorSource
parents
6e9ae8e2
a63c881b
No related branches found
No related tags found
1 merge request
!23
Release
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
bindings/client.go
+4
-3
4 additions, 3 deletions
bindings/client.go
network/follow.go
+9
-12
9 additions, 12 deletions
network/follow.go
network/gateway/hostPool.go
+3
-2
3 additions, 2 deletions
network/gateway/hostPool.go
with
16 additions
and
17 deletions
bindings/client.go
+
4
−
3
View file @
4545d868
...
@@ -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
:=
t
ime
.
Now
()
start
:=
netT
ime
.
Now
()
timeout
:=
time
.
Duration
(
timeoutMS
)
*
time
.
Millisecond
timeout
:=
time
.
Duration
(
timeoutMS
)
*
time
.
Millisecond
for
t
ime
.
Now
()
.
Sub
(
start
)
<
timeout
{
for
netT
ime
.
Now
()
.
Sub
(
start
)
<
timeout
{
if
c
.
api
.
GetHealth
()
.
IsHealthy
()
{
if
c
.
api
.
GetHealth
()
.
IsHealthy
()
{
return
true
return
true
}
}
...
...
This diff is collapsed.
Click to expand it.
network/follow.go
+
9
−
12
View file @
4545d868
...
@@ -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
}
}
...
...
This diff is collapsed.
Click to expand it.
network/gateway/hostPool.go
+
3
−
2
View file @
4545d868
...
@@ -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
d
eadline
e
xceeded
"
,
"connection refused"
,
"host disconnected"
,
var
errorsList
=
[]
string
{
context
.
D
eadline
E
xceeded
.
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"
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment