Github user ppadma commented on a diff in the pull request:
https://github.com/apache/drill/pull/1051#discussion_r153297425
--- Diff:
exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java ---
@@ -873,105 +791,133 @@ public void close() throws Exception {
}
}
- private void moveToState(final QueryState newState, final Exception
exception) {
- logger.debug(queryIdString + ": State change requested {} --> {}",
state, newState,
- exception);
+ public synchronized void moveToState(final QueryState newState, final
Exception exception) {
+ logger.debug(queryIdString + ": State change requested {} --> {}",
state, newState, exception);
switch (state) {
- case ENQUEUED:
- switch (newState) {
- case FAILED:
- Preconditions.checkNotNull(exception, "exception cannot be null
when new state is failed");
- recordNewState(newState);
- foremanResult.setFailed(exception);
- foremanResult.close();
- return;
+ case PLANNING:
+ switch (newState) {
+ case ENQUEUED:
+ recordNewState(newState);
+ enqueuedQueries.inc();
--- End diff --
Decrement plannedQueries ?
---