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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
client
Commits
904f1a31
Commit
904f1a31
authored
Sep 23, 2021
by
Benjamin Wenger
Browse files
Options
Downloads
Patches
Plain Diff
fixed a crash and message pickup bugs
parent
36df9c10
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!53
Release
,
!27
Update deps
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
cmd/root.go
+4
-1
4 additions, 1 deletion
cmd/root.go
network/gateway/sender.go
+16
-4
16 additions, 4 deletions
network/gateway/sender.go
network/rounds/retrieve.go
+3
-2
3 additions, 2 deletions
network/rounds/retrieve.go
with
23 additions
and
7 deletions
cmd/root.go
+
4
−
1
View file @
904f1a31
...
@@ -247,7 +247,10 @@ var rootCmd = &cobra.Command{
...
@@ -247,7 +247,10 @@ var rootCmd = &cobra.Command{
}
}
}
}
fmt
.
Printf
(
"Received %d
\n
"
,
receiveCnt
)
fmt
.
Printf
(
"Received %d
\n
"
,
receiveCnt
)
if
roundsNotepad
!=
nil
{
roundsNotepad
.
INFO
.
Printf
(
"
\n
%s"
,
client
.
GetNetworkInterface
()
.
GetVerboseRounds
())
roundsNotepad
.
INFO
.
Printf
(
"
\n
%s"
,
client
.
GetNetworkInterface
()
.
GetVerboseRounds
())
}
err
=
client
.
StopNetworkFollower
()
err
=
client
.
StopNetworkFollower
()
if
err
!=
nil
{
if
err
!=
nil
{
jww
.
WARN
.
Printf
(
jww
.
WARN
.
Printf
(
...
...
This diff is collapsed.
Click to expand it.
network/gateway/sender.go
+
16
−
4
View file @
904f1a31
...
@@ -26,6 +26,8 @@ type Sender struct {
...
@@ -26,6 +26,8 @@ type Sender struct {
*
HostPool
*
HostPool
}
}
const
RetryableError
=
"Nonfatal error occurred, please retry"
// NewSender Create a new Sender object wrapping a HostPool object
// NewSender Create a new Sender object wrapping a HostPool object
func
NewSender
(
poolParams
PoolParams
,
rng
*
fastRNG
.
StreamGenerator
,
ndf
*
ndf
.
NetworkDefinition
,
getter
HostManager
,
func
NewSender
(
poolParams
PoolParams
,
rng
*
fastRNG
.
StreamGenerator
,
ndf
*
ndf
.
NetworkDefinition
,
getter
HostManager
,
storage
*
storage
.
Session
,
addGateway
chan
network
.
NodeGateway
)
(
*
Sender
,
error
)
{
storage
*
storage
.
Session
,
addGateway
chan
network
.
NodeGateway
)
(
*
Sender
,
error
)
{
...
@@ -47,10 +49,12 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error
...
@@ -47,10 +49,12 @@ func (s *Sender) SendToAny(sendFunc func(host *connect.Host) (interface{}, error
return
nil
,
errors
.
Errorf
(
stoppable
.
ErrMsg
,
stop
.
Name
(),
"SendToAny"
)
return
nil
,
errors
.
Errorf
(
stoppable
.
ErrMsg
,
stop
.
Name
(),
"SendToAny"
)
}
else
if
err
==
nil
{
}
else
if
err
==
nil
{
return
result
,
nil
return
result
,
nil
}
else
if
strings
.
Contains
(
err
.
Error
(),
"unable to connect to target host"
)
{
}
else
if
strings
.
Contains
(
err
.
Error
(),
RetryableError
)
{
// Retry of the proxy could not communicate
// Retry of the proxy could not communicate
jww
.
WARN
.
Printf
(
"Unable to SendToAny via %s:
proxy could not contact requested host
: %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
)
}
else
if
strings
.
Contains
(
err
.
Error
(),
"unable to connect to target host"
)
{
}
else
if
replaced
,
checkReplaceErr
:=
s
.
checkReplace
(
proxies
[
proxy
]
.
GetId
(),
err
);
replaced
{
}
else
if
replaced
,
checkReplaceErr
:=
s
.
checkReplace
(
proxies
[
proxy
]
.
GetId
(),
err
);
replaced
{
if
checkReplaceErr
!=
nil
{
if
checkReplaceErr
!=
nil
{
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"
,
...
@@ -82,6 +86,10 @@ func (s *Sender) SendToPreferred(targets []*id.ID,
...
@@ -82,6 +86,10 @@ func (s *Sender) SendToPreferred(targets []*id.ID,
return
nil
,
errors
.
Errorf
(
stoppable
.
ErrMsg
,
stop
.
Name
(),
"SendToPreferred"
)
return
nil
,
errors
.
Errorf
(
stoppable
.
ErrMsg
,
stop
.
Name
(),
"SendToPreferred"
)
}
else
if
err
==
nil
{
}
else
if
err
==
nil
{
return
result
,
nil
return
result
,
nil
}
else
if
strings
.
Contains
(
err
.
Error
(),
RetryableError
)
{
// 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"
,
targets
[
i
],
targetHosts
[
i
]
.
GetId
(),
err
)
}
else
if
strings
.
Contains
(
err
.
Error
(),
"unable to connect to target host"
)
{
}
else
if
strings
.
Contains
(
err
.
Error
(),
"unable to connect to target host"
)
{
// Retry of the proxy could not communicate
// Retry of the proxy could not communicate
jww
.
WARN
.
Printf
(
"Unable to SendToPreferred first pass %s via %s: %s, "
+
jww
.
WARN
.
Printf
(
"Unable to SendToPreferred first pass %s via %s: %s, "
+
...
@@ -141,6 +149,10 @@ func (s *Sender) SendToPreferred(targets []*id.ID,
...
@@ -141,6 +149,10 @@ func (s *Sender) SendToPreferred(targets []*id.ID,
return
nil
,
errors
.
Errorf
(
stoppable
.
ErrMsg
,
stop
.
Name
(),
"SendToPreferred"
)
return
nil
,
errors
.
Errorf
(
stoppable
.
ErrMsg
,
stop
.
Name
(),
"SendToPreferred"
)
}
else
if
err
==
nil
{
}
else
if
err
==
nil
{
return
result
,
nil
return
result
,
nil
}
else
if
strings
.
Contains
(
err
.
Error
(),
RetryableError
)
{
// Retry of the proxy could not communicate
jww
.
INFO
.
Printf
(
"Unable to SendToPreferred second pass %s via %s: non-fatal error received, retrying: %s"
,
target
,
proxy
,
err
)
}
else
if
strings
.
Contains
(
err
.
Error
(),
"unable to connect to target host"
)
{
}
else
if
strings
.
Contains
(
err
.
Error
(),
"unable to connect to target host"
)
{
// Retry of the proxy could not communicate
// Retry of the proxy could not communicate
jww
.
WARN
.
Printf
(
"Unable to SendToPreferred second pass %s via %s: %s,"
+
jww
.
WARN
.
Printf
(
"Unable to SendToPreferred second pass %s via %s: %s,"
+
...
...
This diff is collapsed.
Click to expand it.
network/rounds/retrieve.go
+
3
−
2
View file @
904f1a31
...
@@ -11,6 +11,7 @@ import (
...
@@ -11,6 +11,7 @@ import (
"encoding/binary"
"encoding/binary"
"github.com/pkg/errors"
"github.com/pkg/errors"
jww
"github.com/spf13/jwalterweatherman"
jww
"github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/network/gateway"
"gitlab.com/elixxir/client/network/message"
"gitlab.com/elixxir/client/network/message"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/client/stoppable"
"gitlab.com/elixxir/client/storage/reception"
"gitlab.com/elixxir/client/storage/reception"
...
@@ -157,8 +158,8 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round,
...
@@ -157,8 +158,8 @@ func (m *Manager) getMessagesFromGateway(roundID id.Round,
// If the gateway doesnt have the round, return an error
// If the gateway doesnt have the round, return an error
msgResp
,
err
:=
comms
.
RequestMessages
(
host
,
msgReq
)
msgResp
,
err
:=
comms
.
RequestMessages
(
host
,
msgReq
)
if
err
==
nil
&&
!
msgResp
.
GetHasRound
()
{
if
err
==
nil
&&
!
msgResp
.
GetHasRound
()
{
jww
.
INFO
.
Printf
(
"No round error for round %d received from %s"
,
roundID
,
target
)
errRtn
:=
errors
.
Errorf
(
noRoundError
,
roundID
)
return
message
.
Bundle
{},
errors
.
Errorf
(
noRoundError
,
roundID
)
return
message
.
Bundle
{},
errors
.
WithMessage
(
errRtn
,
gateway
.
RetryableError
)
}
}
return
msgResp
,
err
return
msgResp
,
err
...
...
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