Description
Query state is changed to QUERY_ERROR when QueryEventType.INTERNAL_ERROR occurs, and QueryFinishEventHandler invoked.
However, there is no check logic for QUERY_ERROR. So stopQuery() never called.
QueryMasterTask.java
private class QueryFinishEventHandler implements EventHandler<QueryMasterQueryCompletedEvent> { @Override public void handle(QueryMasterQueryCompletedEvent event) { QueryId queryId = event.getQueryId(); LOG.info("Query completion notified from " + queryId); while (!isTerminatedState(query.getState())) { try { synchronized (this) { wait(10); } } catch (InterruptedException e) { LOG.error(e); } } LOG.info("Query final state: " + query.getState()); queryMasterContext.stopQuery(queryId); } private boolean isTerminatedState(QueryState state) { return state == QueryState.QUERY_SUCCEEDED || state == QueryState.QUERY_FAILED || state == QueryState.QUERY_KILLED; } }