Github user adeneche commented on a diff in the pull request: https://github.com/apache/drill/pull/503#discussion_r63431381 --- Diff: exec/java-exec/src/main/java/org/apache/drill/exec/work/foreman/Foreman.java --- @@ -1221,6 +1223,12 @@ public void interrupted(final InterruptedException e) { * to the user */ public void moveToState(final QueryState newState, final Exception ex) { + // if the current thread is the foreman thread, throw an exception + // otherwise the foreman will be blocked forever on acceptExternalEvents + if (myThreadRef == Thread.currentThread()) { --- End diff -- We were assuming that the Foreman thread would never call Foreman.StateListener.moveToState() and it would be called by another (rpc) thread instead. It turns out when the foreman is submitting remote fragments, RpcBus.send() could actually cause the foreman thread to call moveToState directly
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---