ZanderXu commented on code in PR #5162:
URL: https://github.com/apache/hadoop/pull/5162#discussion_r1099605922
##########
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:
```
synchronized (sendRpcRequestLock) {
if (shouldCloseConnection.get()) {
return;
}
rpcRequestQueue.put(Pair.of(call, buf));
}
```
About this issue, we only need to ensure that the sender thread will not be
blocked by the `rpcRequestQueue`, and we don't care about whether there are
residual requests in the `rpcRequestQueue`.
This is my coding idea, and looking forward your any good suggestions.
@steveloughran @virajjasani
--
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]