Skip to content

Commit

Permalink
debug: read frame error log
Browse files Browse the repository at this point in the history
  • Loading branch information
ppzqh committed Apr 20, 2024
1 parent 8526b3a commit 990456e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions pkg/remote/trans/nphttp2/grpc/http2_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ package grpc

import (
"context"
"fmt"
"io"
"math"
"net"
Expand Down Expand Up @@ -1034,6 +1035,12 @@ func (t *http2Client) reader() {
// TODO(emma): comment this log temporarily, because when use short connection, 'resource temporarily unavailable' error will happen
// if the log need to be output, connection info should be appended
// klog.Errorf("KITEX: grpc readFrame failed, error=%s", err.Error())
var rAddr string
if t.conn != nil {
rAddr = t.conn.RemoteAddr().String()
}
fmt.Println(err)
klog.Errorf("KITEX: grpc readFrame failed, remoteAddress=%s, error=%s", rAddr, err.Error())
t.Close() // this kicks off resetTransport, so must be last before return
return
}
Expand Down Expand Up @@ -1079,6 +1086,12 @@ func (t *http2Client) reader() {
// TODO(emma): comment this log temporarily, because when use short connection, 'resource temporarily unavailable' error will happen
// if the log need to be output, connection info should be appended
// klog.Errorf("KITEX: grpc readFrame failed, error=%s", err.Error())
var rAddr string
if t.conn != nil {
rAddr = t.conn.RemoteAddr().String()
}
fmt.Println(err)
klog.Errorf("KITEX: grpc readFrame failed, remoteAddress=%s, error=%s", rAddr, err.Error())
t.Close()
return
}
Expand Down

0 comments on commit 990456e

Please sign in to comment.