alex-plekhanov commented on code in PR #12589:
URL: https://github.com/apache/ignite/pull/12589#discussion_r2631411831
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java:
##########
@@ -121,6 +139,11 @@ public QueryAwareTask pollTaskAndBlockQuery(long timeout,
TimeUnit unit) throws
return res;
}
+ catch (Exception e) {
Review Comment:
Fixed
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java:
##########
@@ -101,16 +114,21 @@ public void addTask(QueryAwareTask task) {
/** Poll task and block query. */
public QueryAwareTask pollTaskAndBlockQuery(long timeout, TimeUnit unit)
throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
Review Comment:
Fixed
##########
modules/calcite/src/test/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueueTest.java:
##########
@@ -67,15 +67,13 @@ public void testQueryBlockingUnblocking() throws Exception {
}
};
- // Unparking on unblock query.
+ // Unblock query.
Review Comment:
Fixed
##########
modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/task/QueryTasksQueue.java:
##########
@@ -101,16 +114,21 @@ public void addTask(QueryAwareTask task) {
/** Poll task and block query. */
public QueryAwareTask pollTaskAndBlockQuery(long timeout, TimeUnit unit)
throws InterruptedException {
+ long nanos = unit.toNanos(timeout);
+
lock.lockInterruptibly();
try {
+ freeThreadsCnt--;
+
QueryAwareTask res;
- long nanos = unit.toNanos(timeout);
+ while (cnt.get() == 0 || allTasksBlocked || (allTasksBlocked =
(res = dequeue()) == null)) {
+ if (nanos <= 0L) {
+ freeThreadsCnt++;
- while (cnt.get() == 0 || (res = dequeue()) == null) {
- if (nanos <= 0L)
return null;
+ }
Review Comment:
Fixed
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]