mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-16 04:06:12 +00:00
addressing comments
This commit is contained in:
@@ -214,35 +214,31 @@ func (ss *SignerDialerEndpoint) serviceLoop() {
|
||||
for {
|
||||
select {
|
||||
default:
|
||||
{
|
||||
ss.Logger.Debug("Try connect", "retries", retries, "max", ss.maxConnRetries)
|
||||
ss.Logger.Debug("Try connect", "retries", retries, "max", ss.maxConnRetries)
|
||||
|
||||
if retries > ss.maxConnRetries {
|
||||
ss.Logger.Error("Maximum retries reached", "retries", retries)
|
||||
return
|
||||
}
|
||||
|
||||
if ss.conn == nil {
|
||||
ss.conn, err = ss.dialer()
|
||||
if err != nil {
|
||||
ss.Logger.Info("Try connect", "err", err)
|
||||
ss.conn = nil // Explicitly set to nil because dialer returns an interface (https://golang.org/doc/faq#nil_error)
|
||||
retries++
|
||||
|
||||
// Wait between retries
|
||||
time.Sleep(ss.retryWait)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
retries = 0
|
||||
ss.handleRequest()
|
||||
}
|
||||
|
||||
case <-ss.stopCh:
|
||||
{
|
||||
if retries > ss.maxConnRetries {
|
||||
ss.Logger.Error("Maximum retries reached", "retries", retries)
|
||||
return
|
||||
}
|
||||
|
||||
if ss.conn == nil {
|
||||
ss.conn, err = ss.dialer()
|
||||
if err != nil {
|
||||
ss.Logger.Info("Try connect", "err", err)
|
||||
ss.conn = nil // Explicitly set to nil because dialer returns an interface (https://golang.org/doc/faq#nil_error)
|
||||
retries++
|
||||
|
||||
// Wait between retries
|
||||
time.Sleep(ss.retryWait)
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
||||
retries = 0
|
||||
ss.handleRequest()
|
||||
|
||||
case <-ss.stopCh:
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ func (th *TestHarness) Run() {
|
||||
for acceptRetries := th.acceptRetries; acceptRetries > 0; acceptRetries-- {
|
||||
th.logger.Info("Attempting to accept incoming connection", "acceptRetries", acceptRetries)
|
||||
|
||||
if err := th.signerClient.WaitForConnection(2 * time.Second); err != nil {
|
||||
if err := th.signerClient.WaitForConnection(10 * time.Millisecond); err != nil {
|
||||
// if it wasn't a timeout error
|
||||
if _, ok := err.(timeoutError); !ok {
|
||||
th.logger.Error("Failed to start listener", "err", err)
|
||||
|
||||
@@ -73,7 +73,7 @@ const (
|
||||
)
|
||||
|
||||
func TestRemoteSignerTestHarnessMaxAcceptRetriesReached(t *testing.T) {
|
||||
cfg := makeConfig(t, 200, 2)
|
||||
cfg := makeConfig(t, 1, 2)
|
||||
defer cleanup(cfg)
|
||||
|
||||
th, err := NewTestHarness(log.TestingLogger(), cfg)
|
||||
|
||||
Reference in New Issue
Block a user