ZanderXu commented on code in PR #4527:
URL: https://github.com/apache/hadoop/pull/4527#discussion_r948792683


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java:
##########
@@ -1153,9 +1087,51 @@ public void run() {
             + connections.size());
     }
 
+    /**
+     * A thread to write rpc requests to the socket.
+     */
+    private class RpcRequestSender implements Runnable {
+      @Override
+      public void run() {
+        while (!shouldCloseConnection.get()) {
+          ResponseBuffer buf = null;
+          try {
+            Pair<Call, ResponseBuffer> pair = rpcRequestQueue.take();

Review Comment:
   There is a critical bug after we released this feature in our prod.
   
   `take()` caused `RpcRequestSender` thread leaked if the connection is 
normally idled by itself.
   
   Maybe we should change `take()` to `poll()` as bellows:
   ```
   Pair<Call, ResponseBuffer> pair = rpcRequestQueue.poll(10, 
TimeUnit.MILLISECONDS);
   if (pair == null) {
      continue;
   }
   ```
   



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to