You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ca...@apache.org on 2022/12/05 04:53:26 UTC
[iotdb] branch master updated: [IOTDB-5090] Add npe check in DataNode (#8328)
This is an automated email from the ASF dual-hosted git repository.
caogaofei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new aabae384bf [IOTDB-5090] Add npe check in DataNode (#8328)
aabae384bf is described below
commit aabae384bffda57e2b2d1f05fab637eca7990647
Author: Itami Sho <42...@users.noreply.github.com>
AuthorDate: Mon Dec 5 12:53:19 2022 +0800
[IOTDB-5090] Add npe check in DataNode (#8328)
---
server/src/main/java/org/apache/iotdb/db/service/DataNode.java | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
index 31e4f69efa..7b546fe51e 100644
--- a/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
+++ b/server/src/main/java/org/apache/iotdb/db/service/DataNode.java
@@ -667,8 +667,12 @@ public class DataNode implements DataNodeMBean {
try {
MetricService.getInstance().stop();
- SchemaRegionConsensusImpl.getInstance().stop();
- DataRegionConsensusImpl.getInstance().stop();
+ if (SchemaRegionConsensusImpl.getInstance() != null) {
+ SchemaRegionConsensusImpl.getInstance().stop();
+ }
+ if (DataRegionConsensusImpl.getInstance() != null) {
+ DataRegionConsensusImpl.getInstance().stop();
+ }
} catch (Exception e) {
logger.error("Stop data node error", e);
}