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:
[email protected]


With regards,
Apache Git Services

Reply via email to