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

roryqi 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 69f439334 [#1794] improvement(netty): TransportClientFactory should 
check whether handler is null when creating client (#1795)
69f439334 is described below

commit 69f43933409e6bc0889f6484737d0fc65b85b89d
Author: RickyMa <[email protected]>
AuthorDate: Sun Jun 16 00:17:09 2024 +0800

    [#1794] improvement(netty): TransportClientFactory should check whether 
handler is null when creating client (#1795)
    
    ### What changes were proposed in this pull request?
    
    `TransportClientFactory` should check whether `handler` is `null` when 
creating client.
    
    ### Why are the changes needed?
    
    For: https://github.com/apache/incubator-uniffle/issues/1794.
    
    ### Does this PR introduce _any_ user-facing change?
    
    No.
    
    ### How was this patch tested?
    
    Existing UTs.
---
 .../apache/uniffle/common/netty/client/TransportClientFactory.java  | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git 
a/common/src/main/java/org/apache/uniffle/common/netty/client/TransportClientFactory.java
 
b/common/src/main/java/org/apache/uniffle/common/netty/client/TransportClientFactory.java
index f775ef452..6a3997023 100644
--- 
a/common/src/main/java/org/apache/uniffle/common/netty/client/TransportClientFactory.java
+++ 
b/common/src/main/java/org/apache/uniffle/common/netty/client/TransportClientFactory.java
@@ -121,8 +121,10 @@ public class TransportClientFactory implements Closeable {
       // this code was able to update things.
       TransportChannelHandler handler =
           
cachedClient.getChannel().pipeline().get(TransportChannelHandler.class);
-      synchronized (handler) {
-        handler.getResponseHandler().updateTimeOfLastRequest();
+      if (handler != null) {
+        synchronized (handler) {
+          handler.getResponseHandler().updateTimeOfLastRequest();
+        }
       }
 
       if (cachedClient.isActive()) {

Reply via email to