Skip to content

Commit

Permalink
Reduce log spam in transport service (#44685)
Browse files Browse the repository at this point in the history
The grpc status conversion handled by trace does not map a canceled
status to context.Canceled which leads to additional log spam that
confuses users.
  • Loading branch information
rosstimothy authored Jul 26, 2024
1 parent 21c777c commit 8cb8692
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/srv/transport/transportv1/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ import (
"github.com/gravitational/trace"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/ssh/agent"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials"
"google.golang.org/grpc/peer"
"google.golang.org/grpc/status"

"github.com/gravitational/teleport"
transportv1pb "github.com/gravitational/teleport/api/gen/proto/go/teleport/transport/v1"
Expand Down Expand Up @@ -244,7 +246,7 @@ func (s *Service) ProxySSH(stream transportv1pb.TransportService_ProxySSHServer)
for {
req, err := stream.Recv()
if err != nil {
if !utils.IsOKNetworkError(err) && !errors.Is(err, context.Canceled) {
if !utils.IsOKNetworkError(err) && !errors.Is(err, context.Canceled) && status.Code(err) != codes.Canceled {
s.cfg.Logger.Errorf("ssh stream terminated unexpectedly: %v", err)
}

Expand Down

0 comments on commit 8cb8692

Please sign in to comment.