This commit is contained in:
2025-07-23 18:41:30 +08:00
parent a9add11578
commit 390c5ecff5
12 changed files with 57 additions and 3 deletions

View File

@@ -109,6 +109,12 @@ func chainUnaryInterceptors(interceptors []UnaryClientInterceptor, final Invoker
// NewClient creates a new ttrpc client using the given connection
func NewClient(conn net.Conn, opts ...ClientOpts) *Client {
a := logrus.Fields{
"mzq-test": true,
"conn": fmt.Sprintf("%+v", conn),
"opts": fmt.Sprintf("%+v", opts),
}
logrus.WithFields(a).Info("client.go NewClient")
ctx, cancel := context.WithCancel(context.Background())
channel := newChannel(conn)
c := &Client{
@@ -368,7 +374,12 @@ func (c *Client) receiveLoop() error {
sid := streamID(msg.header.StreamID)
s := c.getStream(sid)
if s == nil {
log.G(c.ctx).WithField("stream", sid).Error("ttrpc: received message on inactive stream")
a := logrus.Fields{
"mzq-test": true,
"stream": sid,
"c": fmt.Sprintf("%+v", c),
}
logrus.WithFields(a).Errorf("ttrpc: received message on inactive stream")
continue
}