This is an automated email from the ASF dual-hosted git repository.
jackietien 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 4b669386216 [To dev/1.3] Fix potential NPE in Unseq List #16360
4b669386216 is described below
commit 4b669386216caed18fffb68f15df6868aa73e175
Author: Jackie Tien <[email protected]>
AuthorDate: Mon Sep 8 10:29:57 2025 +0800
[To dev/1.3] Fix potential NPE in Unseq List #16360
---
.../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 e4470f11f45..25691e3f037 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
@@ -2093,6 +2093,21 @@ public class DataRegion implements IDataRegionForQuery {
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