gunli commented on code in PR #12124:
URL: https://github.com/apache/inlong/pull/12124#discussion_r3246313530


##########
inlong-sdk/dataproxy-sdk-twins/dataproxy-sdk-golang/dataproxy/worker.go:
##########
@@ -416,6 +416,10 @@ func (w *worker) sendBatch(b *batchReq, retryOnFail bool) {
        b.lastSendTime = time.Now()
        b.encode()
 
+       // record the remote server address at the moment the batch is 
dispatched
+       conn := w.getConn()
+       b.lastSendServerAddr = conn.RemoteAddr().String()

Review Comment:
   It is better to use `connpool.getRemoteAddr()` to get the remote address of 
a connection, 'cause it will be nil when it is close by peer, and 
`conn.RemoteAddr().String()` will be panic in that case. 
   You need to update `connpool.getRemoteAddr()` to `connpool.GetRemoteAddr()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to