File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
backend/pkg/transport/network/tcp Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change 11package tcp
22
33import (
4- "errors"
54 "fmt"
65 "net"
7- "syscall"
86 "time"
97
108 "github.com/rs/zerolog"
@@ -38,6 +36,7 @@ func (client *Client) Dial() (net.Conn, error) {
3836
3937 var err error
4038 var conn net.Conn
39+ client .currentRetries = 0
4140 client .logger .Info ().Msg ("dialing" )
4241
4342 for client .config .MaxConnectionRetries <= 0 || client .currentRetries < client .config .MaxConnectionRetries {
@@ -64,8 +63,8 @@ func (client *Client) Dial() (net.Conn, error) {
6463 return nil , client .config .Context .Err ()
6564 }
6665
67- // Check if we should retry this error
68- if netErr , ok := err .(net. Error ); ! client .config .TryReconnect || ( ! errors . Is ( err , syscall . ECONNREFUSED ) && ( ! ok || ! netErr . Timeout ())) {
66+ // If reconnection is disabled, bail out immediately on any error
67+ if ! client .config .TryReconnect {
6968 client .logger .Error ().Stack ().Err (err ).Msg ("failed with non-retryable error" )
7069 return nil , err
7170 }
You can’t perform that action at this time.
0 commit comments