You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by "ZanderXu (via GitHub)" <gi...@apache.org> on 2023/02/08 03:05:21 UTC

[GitHub] [hadoop] ZanderXu commented on a diff in pull request #5162: HDFS-16853. BugFix HADOOP-18324 caused UT TestLeaseRecovery2#testHardLeaseRecoveryAfterNameNodeRestart failed

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


##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java:
##########
@@ -1182,7 +1183,12 @@ public void sendRpcRequest(final Call call)
       final ResponseBuffer buf = new ResponseBuffer();
       header.writeDelimitedTo(buf);
       RpcWritable.wrap(call.rpcRequest).writeTo(buf);
-      rpcRequestQueue.put(Pair.of(call, buf));
+      synchronized (sendRpcRequestLock) {

Review Comment:
   Thanks @steveloughran @virajjasani for your review and sorry for my late response.
   
   I considered this trace during coding.  If the trace happened, my modification only remained one call into the `rpcRequestQueue`, it will not caused the sender thread blocked. And the closed connection will be destroyed by GC.
   



##########
hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/ipc/Client.java:
##########
@@ -1182,7 +1183,12 @@ public void sendRpcRequest(final Call call)
       final ResponseBuffer buf = new ResponseBuffer();
       header.writeDelimitedTo(buf);
       RpcWritable.wrap(call.rpcRequest).writeTo(buf);
-      rpcRequestQueue.put(Pair.of(call, buf));
+      synchronized (sendRpcRequestLock) {

Review Comment:
   Thanks @steveloughran @virajjasani for your review and sorry for my late response.
   
   I considered this trace during coding.  If the trace happened, my modification only remained one call into the `rpcRequestQueue`, it will not caused the sender thread blocked. And the closed connection will be destroyed by GC.
   



-- 
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: common-issues-unsubscribe@hadoop.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org