You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by di...@apache.org on 2023/12/06 11:37:55 UTC
(rocketmq-client-go) branch master updated: feat: connection add debug log (#1118)
This is an automated email from the ASF dual-hosted git repository.
dinglei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-go.git
The following commit(s) were added to refs/heads/master by this push:
new af567d2 feat: connection add debug log (#1118)
af567d2 is described below
commit af567d2ba776004d989f722af8c05186743ee7cf
Author: WeizhongTu <tw...@qq.com>
AuthorDate: Wed Dec 6 19:37:50 2023 +0800
feat: connection add debug log (#1118)
---
internal/remote/remote_client.go | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/internal/remote/remote_client.go b/internal/remote/remote_client.go
index 76db1a1..eabfb75 100644
--- a/internal/remote/remote_client.go
+++ b/internal/remote/remote_client.go
@@ -180,12 +180,20 @@ func (c *remotingClient) receiveResponse(r *tcpConnWrapper) {
return
}
// ignore name server connection read timeout
+ var isTimeout bool
if netErr, ok := err.(net.Error); ok && netErr.Timeout() {
- rlog.Debug("conn error, close connection", map[string]interface{}{
+ isTimeout = true
+ }
+ if !(err == io.EOF || isTimeout) {
+ rlog.Error("conn error, close connection", map[string]interface{}{
+ "remoteAddr": r.RemoteAddr(),
+ "localAddr": r.LocalAddr(),
rlog.LogKeyUnderlayError: err,
})
- } else if err != io.EOF {
- rlog.Error("conn error, close connection", map[string]interface{}{
+ } else {
+ rlog.Debug("conn error, close connection", map[string]interface{}{
+ "remoteAddr": r.RemoteAddr(),
+ "localAddr": r.LocalAddr(),
rlog.LogKeyUnderlayError: err,
})
}