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?
---