You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@kylin.apache.org by GitBox <gi...@apache.org> on 2020/01/21 04:01:00 UTC

[GitHub] [kylin] nichunen commented on a change in pull request #1009: KYLIN-4305 Streaming Receiver cannot limit income query request or ca…

nichunen commented on a change in pull request #1009: KYLIN-4305 Streaming Receiver cannot limit income query request or ca…
URL: https://github.com/apache/kylin/pull/1009#discussion_r368802651
 
 

 ##########
 File path: stream-core/src/main/java/org/apache/kylin/stream/core/query/MultiThreadsResultCollector.java
 ##########
 @@ -69,38 +81,41 @@ public MultiThreadsResultCollector(int numOfWorkers, int timeout) {
 
             @Override
             public boolean hasNext() {
-                boolean exits = (internalIT.hasNext() || queue.size() > 0);
+                boolean exits = (internalIT.hasNext() || !recordCachePool.isEmpty());
                 if (!exits) {
                     while (notCompletedWorkers.get() > 0) {
                         Thread.yield();
-                        long takeTime = System.currentTimeMillis() - startTime;
-                        if (takeTime > timeout) {
+                        if (System.currentTimeMillis() > deadline) {
+                            masterThread.interrupt(); // notify main thread
 
 Review comment:
   Will the workersSemaphore be released if masterThread is interrupted?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services