[ 
https://issues.apache.org/jira/browse/PHOENIX-6918?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17712475#comment-17712475
 ] 

ASF GitHub Bot commented on PHOENIX-6918:
-----------------------------------------

gjacoby126 commented on code in PR #1589:
URL: https://github.com/apache/phoenix/pull/1589#discussion_r1167094574


##########
phoenix-core/src/main/java/org/apache/phoenix/iterate/ScanningResultIterator.java:
##########
@@ -173,6 +177,12 @@ public Tuple next() throws SQLException {
         try {
             Result result = scanner.next();
             while (result != null && (result.isEmpty() || isDummy(result))) {
+                long timeOutForScan = maxQueryEndTime - 
EnvironmentEdgeManager.currentTimeMillis();
+                if (timeOutForScan < 0) {
+                    throw new 
SQLExceptionInfo.Builder(OPERATION_TIMED_OUT).setMessage(
+                            ". Query couldn't be completed in the allotted 
time at ScanningResultIterator: "

Review Comment:
   nit: We probably shouldn't be mentioning Phoenix internals like 
ScanningResultIterator in an error message that goes back to end-users. 



##########
phoenix-core/src/it/java/org/apache/phoenix/end2end/MapReduceIT.java:
##########
@@ -135,6 +164,73 @@ private void createAndTestJob(Connection conn, String s, 
double v, String tenant
 
     }
 
+    private void createPagedJobAndTestFailedJobDueToTimeOut(Connection conn, 
String s, double v, String tenantId,

Review Comment:
   nit: function-level variables should have meaningful names more than 1 
character (not "s" or "v"). (For temp variables in a loop this would be fine)





> ScanningResultIterator should not retry when the query times out
> ----------------------------------------------------------------
>
>                 Key: PHOENIX-6918
>                 URL: https://issues.apache.org/jira/browse/PHOENIX-6918
>             Project: Phoenix
>          Issue Type: Improvement
>            Reporter: Kadir Ozdemir
>            Assignee: Lokesh Khurana
>            Priority: Major
>
> ScanningResultIterator drops dummy results and retries Result#next() in a 
> loop as part of the Phoenix server paging feature.
> ScanningResultIterator does not check if the query has already timed out 
> currently. This means that ScanningResultIterator let the server to work on 
> the scan even though the Phoenix query is already timed out. 
> ScanningResultIterator should check if the query of the scan has been timed 
> out and if so should return an operation timeout exception as 
> BaseResultIterators does.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to