Github user ppadma commented on a diff in the pull request:

    https://github.com/apache/drill/pull/1051#discussion_r153333422
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/rm/ThrottledResourceManager.java
 ---
    @@ -288,8 +287,10 @@ public void setCost(double cost) {
         }
     
         @Override
    -    public void admit() throws QueueTimeoutException, QueryQueueException {
    -      lease = rm.queue().enqueue(foreman.getQueryId(), queryCost);
    +    public void admit() {
    +      QueueAcquirer queueAcquirer = new QueueAcquirer(rm.queue(), foreman, 
queryCost);
    +      queueAcquirerThread = new Thread(queueAcquirer);
    --- End diff --
    
    General comment about the approach. We create minimum 2 threads for any 
query. With this, when queuing is enabled, we are creating minimum three 
threads. Instead, when a query is cancelled,  is it possible to interrupt the 
foreman thread itself if that is blocked ?


---

Reply via email to