horizonzy commented on a change in pull request #8775:
URL: https://github.com/apache/dubbo/pull/8775#discussion_r706731636



##########
File path: 
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
##########
@@ -251,14 +251,12 @@ private String getTimeoutMessage(boolean scan) {
                 + (sent > 0 ? " client elapsed: " + (sent - start)
                 + " ms, server elapsed: " + (nowTimestamp - sent)
                 : " elapsed: " + (nowTimestamp - start)) + " ms, timeout: "
-                + timeout + " ms, request: " + (logger.isDebugEnabled() ? 
request : getRequestWithoutData()) + ", channel: " + channel.getLocalAddress()
+                + timeout + " ms, request: " + (logger.isDebugEnabled() ? 
request : getRequestWithoutData(request)) + ", channel: " + 
channel.getLocalAddress()
                 + " -> " + channel.getRemoteAddress();
     }
 
-    private Request getRequestWithoutData() {
-        Request newRequest = request.copy();
-        newRequest.setData(null);
-        return newRequest;
+    private static Request getRequestWithoutData(Request request) {

Review comment:
       This method can be removed. We can use request. copyWithoutData() 
directly.

##########
File path: 
dubbo-remoting/dubbo-remoting-api/src/main/java/org/apache/dubbo/remoting/exchange/support/DefaultFuture.java
##########
@@ -147,7 +147,7 @@ public static void closeChannel(Channel channel) {
                     disconnectResponse.setErrorMessage("Channel " +
                             channel +
                             " is inactive. Directly return the unFinished 
request : " +
-                            future.getRequest());
+                            getRequestWithoutData(future.getRequest()));

Review comment:
       Here use `logger.isDebugEnabled()`  to judge is print data also.




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