drill-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From paul-rogers <...@git.apache.org>
Subject [GitHub] drill pull request #921: DRILL-4286 Graceful shutdown of drillbit
Date Tue, 14 Nov 2017 22:41:53 GMT
Github user paul-rogers commented on a diff in the pull request:

    https://github.com/apache/drill/pull/921#discussion_r150980131
  
    --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/work/WorkManager.java ---
    @@ -165,32 +169,59 @@ public DrillbitContext getContext() {
        *
        * <p>This is intended to be used by {@link org.apache.drill.exec.server.Drillbit#close()}.</p>
        */
    -  public void waitToExit() {
    +  public void waitToExit(Drillbit bit, boolean forcefulShutdown) {
         synchronized(this) {
    -      if (queries.isEmpty() && runningFragments.isEmpty()) {
    +      numOfRunningQueries = queries.size();
    +      numOfRunningFragments = runningFragments.size();
    --- End diff --
    
    Here we update the counts inside a synchronized block. Do we access them outside the block?
How do we synchronize reads? Or, can these be local variables inside this method?
    
    Or, should we have an `updateQueryCount()` method that handles the updates? That method
would be synchronized, maybe?


---

Mime
View raw message