This is an automated email from the ASF dual-hosted git repository. morningman pushed a commit to branch branch-1.2-lts in repository https://gitbox.apache.org/repos/asf/doris.git
commit f3dd584c1049d936ba596d9f9670fcda3f26605b Author: zzzzzzzs <[email protected]> AuthorDate: Thu May 4 10:03:09 2023 +0800 [improvement](broker) TOperationStatus determines that a null pointer is redundant. (#18712) TOperationStatus determines that a null pointer is redundant. If tOperationStatus is a null pointer, then tOperationStatus.getMessage() will have a null pointer exception. --- .../src/main/java/org/apache/doris/common/util/BrokerReader.java | 4 +++- .../src/main/java/org/apache/doris/common/util/BrokerUtil.java | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerReader.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerReader.java index b59e298c0e..6918311410 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerReader.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerReader.java @@ -126,7 +126,9 @@ public class BrokerReader { } catch (TException e) { LOG.warn("Broker close reader failed. fd={}, address={}", fd.toString(), address, e); } - if (tOperationStatus == null || tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) { + if (tOperationStatus == null) { + LOG.warn("Broker close reader failed. fd={}, address={}", fd.toString(), address); + } else if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) { LOG.warn("Broker close reader failed. fd={}, address={}, error={}", fd.toString(), address, tOperationStatus.getMessage()); } diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerUtil.java b/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerUtil.java index b41c16e6ba..0d03b3b5d2 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerUtil.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/util/BrokerUtil.java @@ -261,7 +261,7 @@ public class BrokerUtil { LOG.warn("Broker close reader failed. path={}, address={}", path, address, ex); } } - if (tOperationStatus == null || tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) { + if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) { LOG.warn("Broker close reader failed. path={}, address={}, error={}", path, address, tOperationStatus.getMessage()); } else { @@ -562,7 +562,9 @@ public class BrokerUtil { LOG.warn("Broker close writer failed. filePath={}, address={}", brokerFilePath, address, ex); } } - if (tOperationStatus == null || tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) { + if (tOperationStatus == null) { + LOG.warn("Broker close reader failed. fd={}, address={}", fd.toString(), address); + } else if (tOperationStatus.getStatusCode() != TBrokerOperationStatusCode.OK) { LOG.warn("Broker close writer failed. filePath={}, address={}, error={}", brokerFilePath, address, tOperationStatus.getMessage()); } else { --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
