You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "yfsn666 (via GitHub)" <gi...@apache.org> on 2026/05/15 03:04:54 UTC

[PR] [INLONG-12121][SDK] Log remote server address on send timeout and server errors in DataProxy Go SDK [inlong]

yfsn666 opened a new pull request, #12124:
URL: https://github.com/apache/inlong/pull/12124

   <!-- Prepare a Pull Request
   Change the title of pull request refer to the following example:
     [INLONG-XYZ][Component] Title of the pull request 
   -->
   
   <!-- Specify the issue this pull request going to fix.
   The following *XYZ* should be replaced by the actual [GitHub Issue](https://github.com/apache/inlong/issues) number)-->
   
   Fixes #12121
   
   ### Motivation
   
   <!--Explain here the context, and why you're making that change. What is the problem you're trying to solve.-->
   Log remote server address on send timeout and server errors in DataProxy Go SDK to facilitate troubleshooting on the server side.
   
   ### Modifications
   
   <!--Describe the modifications you've done.-->
   Record the remote server address when sending batch messages and print it to the logs.
   ### Verifying this change
   
   *(Please pick either of the following options)*
   
   - [x] This change is a trivial rework/code cleanup without any test coverage.
   
   - [ ] This change is already covered by existing tests, such as:
     *(please describe tests)*
   
   - [ ] This change added tests and can be verified as follows:
   
     *(example:)*
     - *Added integration tests for end-to-end deployment with large payloads (10MB)*
     - *Extended integration test for recovery after broker failure*
   
   ### Documentation
   
     - Does this pull request introduce a new feature? no
   


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-12121][SDK] Log remote server address on send timeout and server errors in DataProxy Go SDK [inlong]

Posted by "dockerzhang (via GitHub)" <gi...@apache.org>.
dockerzhang merged PR #12124:
URL: https://github.com/apache/inlong/pull/12124


-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-12121][SDK] Log remote server address on send timeout and server errors in DataProxy Go SDK [inlong]

Posted by "gunli (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [INLONG-12121][SDK] Log remote server address on send timeout and server errors in DataProxy Go SDK [inlong]

Posted by "yfsn666 (via GitHub)" <gi...@apache.org>.
yfsn666 commented on code in PR #12124:
URL: https://github.com/apache/inlong/pull/12124#discussion_r3246505385


##########
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:
   fixed.



-- 
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: commits-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org