This is an automated email from the ASF dual-hosted git repository.
justinchen pushed a commit to branch dev/1.3
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/dev/1.3 by this push:
new 1e29ad90197 [To dev/1.3] Fixed the potential NPE in clear all cache on
local (#16378) (#16382)
1e29ad90197 is described below
commit 1e29ad9019790d4614674187aadeb00a3a14e85b
Author: Caideyipi <[email protected]>
AuthorDate: Wed Sep 10 16:51:38 2025 +0800
[To dev/1.3] Fixed the potential NPE in clear all cache on local (#16378)
(#16382)
---
.../iotdb/db/service/DataNodeInternalRPCService.java | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
index 9c8be161d85..080967e3a69 100644
---
a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
+++
b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/DataNodeInternalRPCService.java
@@ -33,10 +33,12 @@ import
org.apache.iotdb.db.service.metrics.DataNodeInternalRPCServiceMetrics;
import org.apache.iotdb.mpp.rpc.thrift.IDataNodeRPCService.Processor;
import org.apache.iotdb.rpc.DeepCopyRpcTransportFactory;
+import java.util.concurrent.atomic.AtomicReference;
+
public class DataNodeInternalRPCService extends ThriftService
implements DataNodeInternalRPCServiceMBean {
- private DataNodeInternalRPCServiceImpl impl;
+ private final AtomicReference<DataNodeInternalRPCServiceImpl> impl = new
AtomicReference<>();
private DataNodeInternalRPCService() {}
@@ -46,11 +48,10 @@ public class DataNodeInternalRPCService extends
ThriftService
}
@Override
- public void initTProcessor()
- throws ClassNotFoundException, IllegalAccessException,
InstantiationException {
- impl = new DataNodeInternalRPCServiceImpl();
+ public void initTProcessor() {
+ impl.compareAndSet(null, new DataNodeInternalRPCServiceImpl());
initSyncedServiceImpl(null);
- processor = new Processor<>(impl);
+ processor = new Processor<>(impl.get());
}
@Override
@@ -89,7 +90,8 @@ public class DataNodeInternalRPCService extends ThriftService
}
public DataNodeInternalRPCServiceImpl getImpl() {
- return impl;
+ impl.compareAndSet(null, new DataNodeInternalRPCServiceImpl());
+ return impl.get();
}
private static class DataNodeInternalRPCServiceHolder {