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

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 4574647a3a [ISSUE #8909] Move nullcheck ahead (#8910)
4574647a3a is described below

commit 4574647a3a20a17562a0d3fc34b1c8394cc53b8e
Author: jiao jianan <81030751+jjas...@users.noreply.github.com>
AuthorDate: Sat Nov 16 09:07:55 2024 +0800

    [ISSUE #8909] Move nullcheck ahead (#8910)
    
    Co-authored-by: jiaoja <jia...@asiainfo.com>
---
 .../org/apache/rocketmq/common/config/AbstractRocksDBStorage.java  | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/common/src/main/java/org/apache/rocketmq/common/config/AbstractRocksDBStorage.java
 
b/common/src/main/java/org/apache/rocketmq/common/config/AbstractRocksDBStorage.java
index d434cce745..28ed4e924c 100644
--- 
a/common/src/main/java/org/apache/rocketmq/common/config/AbstractRocksDBStorage.java
+++ 
b/common/src/main/java/org/apache/rocketmq/common/config/AbstractRocksDBStorage.java
@@ -346,12 +346,13 @@ public abstract class AbstractRocksDBStorage {
             this.db = RocksDB.open(this.options, this.dbPath, cfDescriptors, 
cfHandles);
         }
         assert cfDescriptors.size() == cfHandles.size();
-        try (Env env = this.db.getEnv()) {
-            env.setBackgroundThreads(8, Priority.LOW);
-        }
+
         if (this.db == null) {
             throw new RocksDBException("open rocksdb null");
         }
+        try (Env env = this.db.getEnv()) {
+            env.setBackgroundThreads(8, Priority.LOW);
+        }
     }
 
     protected abstract boolean postLoad();

Reply via email to