Skip to content

Commit

Permalink
Terminate the query after plan generation if timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
jasperjiaguo committed Sep 13, 2022
1 parent 987480b commit 9e5b0a7
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public DataTable execute() {
InstanceResponseOperator instanceResponseOperator = _instanceResponsePlanNode.run();
long endTime1 = System.currentTimeMillis();
LOGGER.debug("InstanceResponsePlanNode.run() took: {}ms", endTime1 - startTime);
if (endTime1 > _instanceResponsePlanNode._queryContext.getEndTimeMs()) {
throw new RuntimeException("Timeout after plan generation");
}
InstanceResponseBlock instanceResponseBlock = instanceResponseOperator.nextBlock();
long endTime2 = System.currentTimeMillis();
LOGGER.debug("InstanceResponseOperator.nextBlock() took: {}ms", endTime2 - endTime1);
Expand Down

0 comments on commit 9e5b0a7

Please sign in to comment.