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 2024/06/19 03:47:42 UTC
(iotdb) branch IOTDB-6342 created (now f6aa81d2d40)
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a change to branch IOTDB-6342
in repository https://gitbox.apache.org/repos/asf/iotdb.git
at f6aa81d2d40 [IOTDB-6342] Clear FragmentInstanceManager.dataNodeQueryContextMap while encountering MemoryNotEnough Exception
This branch includes the following new commits:
new f6aa81d2d40 [IOTDB-6342] Clear FragmentInstanceManager.dataNodeQueryContextMap while encountering MemoryNotEnough Exception
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: [IOTDB-6342] Clear FragmentInstanceManager.dataNodeQueryContextMap while encountering MemoryNotEnough Exception
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jackietien pushed a commit to branch IOTDB-6342
in repository https://gitbox.apache.org/repos/asf/iotdb.git
commit f6aa81d2d407bdf295fae92b8c66e117b96a48de
Author: JackieTien97 <ja...@gmail.com>
AuthorDate: Wed Jun 19 11:47:22 2024 +0800
[IOTDB-6342] Clear FragmentInstanceManager.dataNodeQueryContextMap while encountering MemoryNotEnough Exception
---
.../execution/fragment/FragmentInstanceContext.java | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
index 3748372c4f6..a109fe84963 100644
--- a/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
+++ b/iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/fragment/FragmentInstanceContext.java
@@ -265,6 +265,14 @@ public class FragmentInstanceContext extends QueryContext {
// were a duplicate notification, which shouldn't happen
executionEndTime.compareAndSet(END_TIME_INITIAL_VALUE, now);
endNanos.compareAndSet(0, System.nanoTime());
+
+ // release some query resource in FragmentInstanceContext
+ // why not release them in releaseResourceWhenAllDriversAreClosed() together?
+ // because we may have no chane to run the releaseResourceWhenAllDriversAreClosed which is
+ // called in callback of FragmentInstanceExecution
+ // FragmentInstanceExecution won't be created if we meet some errors like MemoryNotEnough
+ releaseDataNodeQueryContext();
+ sourcePaths = null;
}
}
@@ -596,9 +604,7 @@ public class FragmentInstanceContext extends QueryContext {
dataRegion = null;
globalTimeFilter = null;
- sourcePaths = null;
sharedQueryDataSource = null;
- releaseDataNodeQueryContext();
// record fragment instance execution time and metadata get time to metrics
long durationTime = System.currentTimeMillis() - executionStartTime.get();
@@ -659,7 +665,7 @@ public class FragmentInstanceContext extends QueryContext {
.updatePageReaderMemoryUsage(getQueryStatistics().pageReaderMaxUsedMemorySize.get());
}
- private void releaseDataNodeQueryContext() {
+ private synchronized void releaseDataNodeQueryContext() {
if (dataNodeQueryContextMap == null) {
// this process is in fetch schema, nothing need to release
return;