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

xuyang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new a65901578bb [bug](cloud) fix null pointer exception in get partition 
visible version rpc (#33070)
a65901578bb is described below

commit a65901578bb406a11b436fa646f33658ecc314c0
Author: xy720 <22125576+xy...@users.noreply.github.com>
AuthorDate: Sun Apr 7 15:39:20 2024 +0800

    [bug](cloud) fix null pointer exception in get partition visible version 
rpc (#33070)
    
    fix null pointer exception in get partition visible version rpc
---
 .../java/org/apache/doris/cloud/qe/SnapshotProxy.java | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/cloud/qe/SnapshotProxy.java 
b/fe/fe-core/src/main/java/org/apache/doris/cloud/qe/SnapshotProxy.java
index 1f4b20ab1dd..86bc19ecbec 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/cloud/qe/SnapshotProxy.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/cloud/qe/SnapshotProxy.java
@@ -38,17 +38,18 @@ public class SnapshotProxy {
         while (tryTimes++ < Config.meta_service_rpc_retry_times) {
             Cloud.GetVersionResponse resp = getVisibleVersionInternal(request,
                     Config.default_get_version_from_ms_timeout_second * 1000);
-            if (resp.hasStatus() && (resp.getStatus().getCode() == 
Cloud.MetaServiceCode.OK
-                    || resp.getStatus().getCode() == 
Cloud.MetaServiceCode.VERSION_NOT_FOUND)) {
-                if (LOG.isDebugEnabled()) {
-                    LOG.debug("get version from meta service, code: {}", 
resp.getStatus().getCode());
+            if (resp != null) {
+                if (resp.hasStatus() && (resp.getStatus().getCode() == 
Cloud.MetaServiceCode.OK
+                        || resp.getStatus().getCode() == 
Cloud.MetaServiceCode.VERSION_NOT_FOUND)) {
+                    if (LOG.isDebugEnabled()) {
+                        LOG.debug("get version from meta service, code: {}", 
resp.getStatus().getCode());
+                    }
+                    return resp;
                 }
-                return resp;
-            }
-
-            LOG.warn("get version from meta service failed, status: {}, retry 
time: {}",
-                    resp.getStatus(), tryTimes);
 
+                LOG.warn("get version from meta service failed, status: {}, 
retry time: {}",
+                        resp.getStatus(), tryTimes);
+            }
             // sleep random millis, retry rpc failed
             if (tryTimes > Config.meta_service_rpc_retry_times / 2) {
                 sleepSeveralMs(500, 1000);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to