You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ja...@apache.org on 2025/09/08 01:55:39 UTC
(iotdb) branch LockNPE created (now 3761e696a1a)
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a change to branch LockNPE
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at 3761e696a1a Fix potential NPE in Unseq List
This branch includes the following new commits:
new 3761e696a1a Fix potential NPE in Unseq List
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
(iotdb) 01/01: Fix potential NPE in Unseq List
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch LockNPE
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit 3761e696a1aff5ffd044c1e0042b7f3a40f149e7
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Mon Sep 8 09:54:42 2025 +0800
Fix potential NPE in Unseq List
---
.../iotdb/db/storageengine/dataregion/DataRegion.java | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
index 2d9024112b3..91ad671a19e 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/DataRegion.java
@@ -2204,6 +2204,21 @@ public class DataRegion implements IDataRegionForQuery {
&& tsFileResource.isSatisfied(singleDeviceId, globalTimeFilter, false, isDebug)) {
TsFileProcessor tsFileProcessor = tsFileResource.getProcessor();
try {
+ if (tsFileProcessor == null) {
+ // tsFileProcessor == null means this tsfile is being closed, here we try to busy loop
+ // until status in TsFileResource has been changed which is supposed to be the last step
+ // of closing
+ while (!tsFileResource.isClosed() && waitTimeInMs > 0) {
+ TimeUnit.MILLISECONDS.sleep(5);
+ waitTimeInMs -= 5;
+ }
+ if (tsFileResource.isClosed()) {
+ continue;
+ } else {
+ clearAlreadyLockedList(needToUnLockList);
+ return false;
+ }
+ }
long startTime = System.nanoTime();
if (tsFileProcessor.tryReadLock(waitTimeInMs)) {
// minus already consumed time