diff --git a/client/listener.go b/client/listener.go index 41dab9d..a7049bb 100644 --- a/client/listener.go +++ b/client/listener.go @@ -4,9 +4,7 @@ import ( "context" "errors" "fmt" - "io" "net" - "strings" "github.com/andydunstall/yamux" "go.uber.org/zap" @@ -81,11 +79,7 @@ func (l *listener) AcceptWithContext(ctx context.Context) (net.Conn, error) { return nil, ErrClosed } - if err != io.EOF && !strings.Contains(err.Error(), "closed") && !strings.Contains(err.Error(), "reset by peer") { - l.logger.Error("failed to accept conn", zap.Error(err)) - } else { - l.logger.Warn("disconnected; reconnecting") - } + l.logger.Warn("disconnected; reconnecting", zap.Error(err)) if err := l.connect(l.closeCtx); err != nil { return nil, fmt.Errorf("connect: %w", err) diff --git a/client/upstream.go b/client/upstream.go index b809388..8066ea2 100644 --- a/client/upstream.go +++ b/client/upstream.go @@ -146,7 +146,7 @@ func (u *Upstream) connect(ctx context.Context, endpointID string) (*yamux.Sessi return nil, err } - u.logger().Error( + u.logger().Warn( "connect failed; retrying", zap.String("endpoint-id", endpointID), zap.String("url", url), diff --git a/go.mod b/go.mod index 720dbbb..f9e8dc6 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/andydunstall/piko go 1.22 require ( - github.com/andydunstall/yamux v0.1.3 + github.com/andydunstall/yamux v0.1.4 github.com/gin-gonic/gin v1.10.0 github.com/goccy/go-yaml v1.12.0 github.com/golang-jwt/jwt/v5 v5.2.1 diff --git a/go.sum b/go.sum index ec9c42b..468a116 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/andydunstall/yamux v0.1.3 h1:lTNkGpbbVuAttKhnn5W290a1yMWVav3GnijrcHhjuKU= -github.com/andydunstall/yamux v0.1.3/go.mod h1:v4C9l2I4bhYdww+IVgjO0o5rVzxXbx2nneuFDHvyM28= +github.com/andydunstall/yamux v0.1.4 h1:VrcjPsG5gUb8QnUFdHXoJnmFfncnu0wbeEjekZs4M78= +github.com/andydunstall/yamux v0.1.4/go.mod h1:v4C9l2I4bhYdww+IVgjO0o5rVzxXbx2nneuFDHvyM28= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=