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

    https://github.com/apache/drill/pull/1196#discussion_r178376213
  
    --- Diff: 
exec/java-exec/src/main/java/org/apache/drill/exec/work/WorkManager.java ---
    @@ -212,19 +218,29 @@ private boolean areQueriesAndFragmentsEmpty() {
         return queries.isEmpty() && runningFragments.isEmpty();
       }
     
    +  /**
    +   * Check if there any new queries or fragments that are added after the 
shutdown is triggered
    +   */
    +  private boolean areNewQueriesOrFragmentsAdded() {
    +    return runningFragments.size() > numOfRunningFragments || 
queries.size() > numOfRunningQueries;
    --- End diff --
    
    This condition is not reliable. What if some fragments exited and some were 
added? The total number may still be less than the number of fragments when the 
shutdown was requested.


---

Reply via email to