ChinmaySKulkarni commented on a change in pull request #749: PHOENIX-4521:
Allow Pherf scenario to define per query max allowed query execution duration
after which thread is interrupted
URL: https://github.com/apache/phoenix/pull/749#discussion_r402656219
##########
File path:
phoenix-pherf/src/main/java/org/apache/phoenix/pherf/workload/MultithreadedDiffer.java
##########
@@ -59,7 +62,8 @@ private void diffQuery() throws Exception {
getThreadTime().getRunTimesInMs().add(new RunTime(
verifyResult == true ? PherfConstants.DIFF_PASS :
PherfConstants.DIFF_FAIL,
explainPlan, startDate, -1L,
- (int) (EnvironmentEdgeManager.currentTimeMillis() - start)));
+ (int) (EnvironmentEdgeManager.currentTimeMillis() - start),
(EnvironmentEdgeManager.currentTimeMillis() - start) >= executionDurationInMs));
+ return ((EnvironmentEdgeManager.currentTimeMillis() - start) >=
executionDurationInMs);
Review comment:
You should probably call `EnvironmentEdgeManager.currentTimeMillis() -
start` just once, assign it to a variable and use that here, rather than
calling it twice. Otherwise, we could run into a situation where the `RunTime`
object indicates no timeout, but diffQuery returns true if we're really close.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services