You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2017/08/14 10:30:54 UTC
[44/50] ignite git commit: Proper cleanup.
Proper cleanup.
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/125dd071
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/125dd071
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/125dd071
Branch: refs/heads/ignite-5991-6019
Commit: 125dd071254c78afb991a7ee4016ddb081f98fe2
Parents: 74e25e3
Author: devozerov <vo...@gridgain.com>
Authored: Mon Aug 14 13:08:30 2017 +0300
Committer: devozerov <vo...@gridgain.com>
Committed: Mon Aug 14 13:08:30 2017 +0300
----------------------------------------------------------------------
.../query/h2/twostep/GridReduceQueryExecutor.java | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/125dd071/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
----------------------------------------------------------------------
diff --git a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
index 1091883..a572906 100644
--- a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
+++ b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridReduceQueryExecutor.java
@@ -666,6 +666,8 @@ public class GridReduceQueryExecutor {
runs.put(qryReqId, r);
+ boolean release = true;
+
try {
cancel.checkCancelled();
@@ -755,8 +757,11 @@ public class GridReduceQueryExecutor {
Iterator<List<?>> resIter = null;
if (!retry) {
- if (skipMergeTbl)
+ if (skipMergeTbl) {
resIter = new GridMergeIndexesIterator(this, finalNodes, r, qryReqId, qry.distributedJoins());
+
+ release = false;
+ }
else {
cancel.checkCancelled();
@@ -798,6 +803,8 @@ public class GridReduceQueryExecutor {
return new GridQueryCacheObjectsIterator(resIter, h2.objectContext(), keepBinary);
}
catch (IgniteCheckedException | RuntimeException e) {
+ release = true;
+
U.closeQuiet(r.connection());
if (e instanceof CacheException) {
@@ -820,12 +827,13 @@ public class GridReduceQueryExecutor {
throw new CacheException("Failed to run reduce query locally.", cause);
}
finally {
- // If we have fetched all data to merge table, then let's free all resources here.
- if (!skipMergeTbl) {
+ if (release) {
releaseRemoteResources(finalNodes, r, qryReqId, qry.distributedJoins());
- for (int i = 0, mapQrys = qry.mapQueries().size(); i < mapQrys; i++)
- fakeTable(null, i).innerTable(null); // Drop all merge tables.
+ if (!skipMergeTbl) {
+ for (int i = 0, mapQrys = qry.mapQueries().size(); i < mapQrys; i++)
+ fakeTable(null, i).innerTable(null); // Drop all merge tables.
+ }
}
}
}