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 ed68ff79994 [To dev/1.3] Fix potential NPE in tryGetFLushLock
ed68ff79994 is described below
commit ed68ff79994414778914ef0ee3e55ba2d3bb019b
Author: Jackie Tien <[email protected]>
AuthorDate: Wed Aug 27 09:44:22 2025 +0800
[To dev/1.3] Fix potential NPE in tryGetFLushLock
---
.../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 b68a7199436..e4470f11f45 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
@@ -2046,6 +2046,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