echonesis commented on code in PR #10591:
URL: https://github.com/apache/ozone/pull/10591#discussion_r3489582297


##########
hadoop-ozone/common/src/main/java/org/apache/hadoop/ozone/om/protocolPB/GrpcOmTransport.java:
##########
@@ -183,14 +276,7 @@ public OMResponse submitRequest(OMRequest payload) throws 
IOException {
       tryOtherHost = false;
       expectedFailoverCount = globalFailoverCount.get();
       try {
-        InetAddress inetAddress = InetAddress.getLocalHost();
-        Context.current()
-            .withValue(GrpcClientConstants.CLIENT_IP_ADDRESS_CTX_KEY,
-                inetAddress.getHostAddress())
-            .withValue(GrpcClientConstants.CLIENT_HOSTNAME_CTX_KEY,
-                inetAddress.getHostName())
-            .run(() -> resp.set(clients.get(host.get())
-                .submitRequest(payload)));
+        resp.set(submitRequestToHost(payload, host.get()));

Review Comment:
   Thanks for pointing this out!
   I updated `submitRequestToLeader()` to return `submitRequestToHost(payload, 
host.get())` directly instead of storing the response in another 
`AtomicReference`.



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