Repository: ignite
Updated Branches:
  refs/heads/ignite-2.5 2be10fdcd -> 7f463be9f


IGNITE-8204: SQL: fixed hangs when lazy flag is enabled. This closes #3785.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/7f463be9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/7f463be9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/7f463be9

Branch: refs/heads/ignite-2.5
Commit: 7f463be9ff6c5d2d84b0aacc888159ffe68bf269
Parents: 2be10fd
Author: Alexander Paschenko <alexander.a.pasche...@gmail.com>
Authored: Wed Apr 11 16:20:16 2018 +0300
Committer: devozerov <voze...@gridgain.com>
Committed: Wed Apr 11 16:24:24 2018 +0300

----------------------------------------------------------------------
 .../query/h2/twostep/GridMapQueryExecutor.java         |  7 +++++++
 .../query/h2/twostep/MapQueryLazyWorker.java           | 13 +++++++++++--
 2 files changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/7f463be9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
index 9b1e4fa..930ada2 100644
--- 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
+++ 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/GridMapQueryExecutor.java
@@ -234,6 +234,13 @@ public class GridMapQueryExecutor {
     }
 
     /**
+     * @return Busy lock for lazy workers to guard their operations with.
+     */
+    GridSpinBusyLock busyLock() {
+        return busyLock;
+    }
+
+    /**
      * @param node Node.
      * @param msg Message.
      */

http://git-wip-us.apache.org/repos/asf/ignite/blob/7f463be9/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
----------------------------------------------------------------------
diff --git 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
index 59c050f..98f3df9 100644
--- 
a/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
+++ 
b/modules/indexing/src/main/java/org/apache/ignite/internal/processors/query/h2/twostep/MapQueryLazyWorker.java
@@ -80,8 +80,17 @@ public class MapQueryLazyWorker extends GridWorker {
             while (!isCancelled()) {
                 Runnable task = tasks.take();
 
-                if (task != null)
-                    task.run();
+                if (task != null) {
+                    if (!exec.busyLock().enterBusy())
+                        return;
+
+                    try {
+                        task.run();
+                    }
+                    finally {
+                        exec.busyLock().leaveBusy();
+                    }
+                }
             }
         }
         finally {

Reply via email to