Skip to content
Snippets Groups Projects
Commit 38842402 authored by Richard T. Carback III's avatar Richard T. Carback III
Browse files

Merge branch 'release' of git.xx.network:elixxir/client into release

parents 9f6535a5 7f9eb7f2
No related branches found
No related tags found
1 merge request!53Release
...@@ -179,7 +179,7 @@ Flags: ...@@ -179,7 +179,7 @@ Flags:
(default 1) (default 1)
--sendDelay uint The delay between sending the messages in ms --sendDelay uint The delay between sending the messages in ms
(default 500) (default 500)
--sendid uint Use precanned user id (must be between 1 and --sendid uiverboseRoundTrackingnt Use precanned user id (must be between 1 and
40, inclusive) 40, inclusive)
--slowPolling bool Enables polling for all network updates and RSA signed rounds. --slowPolling bool Enables polling for all network updates and RSA signed rounds.
Defaults to true (filtered updates with ECC signed rounds) if not set Defaults to true (filtered updates with ECC signed rounds) if not set
...@@ -190,6 +190,9 @@ Flags: ...@@ -190,6 +190,9 @@ Flags:
--unsafe-channel-creation Turns off the user identity authenticated --unsafe-channel-creation Turns off the user identity authenticated
channel check, automatically approving channel check, automatically approving
authenticated channels authenticated channels
--verboseRoundTracking Verbose round tracking, keeps track and prints
all rounds the client was aware of while running.
Defaults to false if not set.
-v, --logLevel uint Level of debugging to print (0 = info, -v, --logLevel uint Level of debugging to print (0 = info,
1 = debug, >1 = trace). (Default info) 1 = debug, >1 = trace). (Default info)
--waitTimeout uint The number of seconds to wait for messages to --waitTimeout uint The number of seconds to wait for messages to
......
...@@ -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(
...@@ -384,7 +387,7 @@ func createClient() *api.Client { ...@@ -384,7 +387,7 @@ func createClient() *api.Client {
netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds") netParams.ForceHistoricalRounds = viper.GetBool("forceHistoricalRounds")
netParams.FastPolling = !viper.GetBool("slowPolling") netParams.FastPolling = !viper.GetBool("slowPolling")
netParams.ForceMessagePickupRetry = viper.GetBool("forceMessagePickupRetry") netParams.ForceMessagePickupRetry = viper.GetBool("forceMessagePickupRetry")
netParams.VerboseRoundTracking = logLevel > 0 netParams.VerboseRoundTracking = viper.GetBool("verboseRoundTracking")
client, err := api.OpenClient(storeDir, []byte(pass), netParams) client, err := api.OpenClient(storeDir, []byte(pass), netParams)
if err != nil { if err != nil {
...@@ -412,7 +415,7 @@ func initClient() *api.Client { ...@@ -412,7 +415,7 @@ func initClient() *api.Client {
jww.INFO.Printf("Setting Uncheck Round Period to %v", period) jww.INFO.Printf("Setting Uncheck Round Period to %v", period)
netParams.UncheckRoundPeriod = period netParams.UncheckRoundPeriod = period
} }
netParams.VerboseRoundTracking = viper.GetUint("logLevel") > 0 netParams.VerboseRoundTracking = viper.GetBool("verboseRoundTracking")
//load the client //load the client
client, err := api.Login(storeDir, []byte(pass), netParams) client, err := api.Login(storeDir, []byte(pass), netParams)
...@@ -729,6 +732,11 @@ func init() { ...@@ -729,6 +732,11 @@ func init() {
"Verbose mode for debugging") "Verbose mode for debugging")
viper.BindPFlag("logLevel", rootCmd.PersistentFlags().Lookup("logLevel")) viper.BindPFlag("logLevel", rootCmd.PersistentFlags().Lookup("logLevel"))
rootCmd.PersistentFlags().Bool("verboseRoundTracking", false,
"Verbose round tracking, keeps track and prints all rounds the " +
"client was aware of while running. Defaults to false if not set.")
viper.BindPFlag("verboseRoundTracking", rootCmd.PersistentFlags().Lookup("verboseRoundTracking"))
rootCmd.PersistentFlags().StringP("session", "s", rootCmd.PersistentFlags().StringP("session", "s",
"", "Sets the initial storage directory for "+ "", "Sets the initial storage directory for "+
"client session data") "client session data")
......
...@@ -17,7 +17,7 @@ require ( ...@@ -17,7 +17,7 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 github.com/spf13/jwalterweatherman v1.1.0
github.com/spf13/viper v1.7.1 github.com/spf13/viper v1.7.1
gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228
gitlab.com/elixxir/comms v0.0.4-0.20210921011907-2be8c9faa4d8 gitlab.com/elixxir/comms v0.0.4-0.20210923193811-eff1796c4f06
gitlab.com/elixxir/crypto v0.0.7-0.20210920180151-6c9b84bae372 gitlab.com/elixxir/crypto v0.0.7-0.20210920180151-6c9b84bae372
gitlab.com/elixxir/ekv v0.1.5 gitlab.com/elixxir/ekv v0.1.5
gitlab.com/elixxir/primitives v0.0.3-0.20210920180121-b85bca5212f4 gitlab.com/elixxir/primitives v0.0.3-0.20210920180121-b85bca5212f4
......
...@@ -253,8 +253,8 @@ github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0= ...@@ -253,8 +253,8 @@ github.com/zeebo/pcg v1.0.0 h1:dt+dx+HvX8g7Un32rY9XWoYnd0NmKmrIzpHF7qiTDj0=
github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4= github.com/zeebo/pcg v1.0.0/go.mod h1:09F0S9iiKrwn9rlI5yjLkmrug154/YRW6KnnXVDM/l4=
gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0BJIk1HIzBVMjWNjIUfstrsXC2VqLYPcA= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228 h1:Gi6rj4mAlK0BJIk1HIzBVMjWNjIUfstrsXC2VqLYPcA=
gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k= gitlab.com/elixxir/bloomfilter v0.0.0-20200930191214-10e9ac31b228/go.mod h1:H6jztdm0k+wEV2QGK/KYA+MY9nj9Zzatux/qIvDDv3k=
gitlab.com/elixxir/comms v0.0.4-0.20210921011907-2be8c9faa4d8 h1:MqVGu0ADBHMw7rfiSJTG4PRlGk8c8N6GLY1CwJwC3Dk= gitlab.com/elixxir/comms v0.0.4-0.20210923193811-eff1796c4f06 h1:/eravscU36XKXmGdPfDTNNNgjc1eEhsRwwbir43SS64=
gitlab.com/elixxir/comms v0.0.4-0.20210921011907-2be8c9faa4d8/go.mod h1:h41+FHc9zlQGveEao3aw8VSfzyOPecEhhUIadUsW1C8= gitlab.com/elixxir/comms v0.0.4-0.20210923193811-eff1796c4f06/go.mod h1:h41+FHc9zlQGveEao3aw8VSfzyOPecEhhUIadUsW1C8=
gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c= gitlab.com/elixxir/crypto v0.0.0-20200804182833-984246dea2c4/go.mod h1:ucm9SFKJo+K0N2GwRRpaNr+tKXMIOVWzmyUD0SbOu2c=
gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA= gitlab.com/elixxir/crypto v0.0.3/go.mod h1:ZNgBOblhYToR4m8tj4cMvJ9UsJAUKq+p0gCp07WQmhA=
gitlab.com/elixxir/crypto v0.0.7-0.20210920180151-6c9b84bae372 h1:W5Ax+cwqOOcsVegaMLvsFJ/Cs24a4Wyhp5UHFwvMQxo= gitlab.com/elixxir/crypto v0.0.7-0.20210920180151-6c9b84bae372 h1:W5Ax+cwqOOcsVegaMLvsFJ/Cs24a4Wyhp5UHFwvMQxo=
......
...@@ -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," +
......
...@@ -107,6 +107,9 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard, ...@@ -107,6 +107,9 @@ func NewManager(session *storage.Session, switchboard *switchboard.Switchboard,
Events: events, Events: events,
} }
// Set up node registration chan for network instance
m.Instance.SetAddGatewayChan(m.NodeRegistration)
// Set up gateway.Sender // Set up gateway.Sender
poolParams := gateway.DefaultPoolParams() poolParams := gateway.DefaultPoolParams()
// Client will not send KeepAlive packets // Client will not send KeepAlive packets
......
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment