This is an automated email from the ASF dual-hosted git repository.

zuston pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new 9f4ccde36 [#1472][part-6] followup: Fix Netty transport time when 
sending shuffle data requests (#1551)
9f4ccde36 is described below

commit 9f4ccde36bcce22e033dc7c7b83f263e6e252f53
Author: RickyMa <[email protected]>
AuthorDate: Thu Feb 29 11:49:23 2024 +0800

    [#1472][part-6] followup: Fix Netty transport time when sending shuffle 
data requests (#1551)
    
    ### What changes were proposed in this pull request?
    
    Refresh `timestamp` when sending `SendShuffleDataRequest`.
    
    ### Why are the changes needed?
    
    A follow-up PR for: https://github.com/apache/incubator-uniffle/pull/1534
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Existing UTs.
---
 .../apache/uniffle/common/netty/protocol/SendShuffleDataRequest.java  | 4 ++++
 .../apache/uniffle/client/impl/grpc/ShuffleServerGrpcNettyClient.java | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/common/src/main/java/org/apache/uniffle/common/netty/protocol/SendShuffleDataRequest.java
 
b/common/src/main/java/org/apache/uniffle/common/netty/protocol/SendShuffleDataRequest.java
index cab47693b..492b5b64b 100644
--- 
a/common/src/main/java/org/apache/uniffle/common/netty/protocol/SendShuffleDataRequest.java
+++ 
b/common/src/main/java/org/apache/uniffle/common/netty/protocol/SendShuffleDataRequest.java
@@ -141,4 +141,8 @@ public class SendShuffleDataRequest extends RequestMessage {
   public long getTimestamp() {
     return timestamp;
   }
+
+  public void setTimestamp(long timestamp) {
+    this.timestamp = timestamp;
+  }
 }
diff --git 
a/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcNettyClient.java
 
b/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcNettyClient.java
index 7949ca925..2097b89f1 100644
--- 
a/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcNettyClient.java
+++ 
b/internal-client/src/main/java/org/apache/uniffle/client/impl/grpc/ShuffleServerGrpcNettyClient.java
@@ -116,7 +116,7 @@ public class ShuffleServerGrpcNettyClient extends 
ShuffleServerGrpcClient {
       try {
         RetryUtils.retryWithCondition(
             () -> {
-              TransportClient transportClient = getTransportClient();
+              final TransportClient transportClient = getTransportClient();
               long requireId =
                   requirePreAllocation(
                       request.getAppId(),
@@ -129,8 +129,8 @@ public class ShuffleServerGrpcNettyClient extends 
ShuffleServerGrpcClient {
                         "requirePreAllocation failed! size[%s], host[%s], 
port[%s]",
                         allocateSize, host, port));
               }
-
               sendShuffleDataRequest.setRequireId(requireId);
+              sendShuffleDataRequest.setTimestamp(System.currentTimeMillis());
               long start = System.currentTimeMillis();
               RpcResponse rpcResponse =
                   transportClient.sendRpcSync(sendShuffleDataRequest, 
rpcTimeout);

Reply via email to