[ https://issues.apache.org/jira/browse/PHOENIX-6185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17213117#comment-17213117 ]
ASF GitHub Bot commented on PHOENIX-6185: ----------------------------------------- virajjasani opened a new pull request #919: URL: https://github.com/apache/phoenix/pull/919 ---------------------------------------------------------------- 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: us...@infra.apache.org > OPERATION_TIMED_OUT#newException method swallows the exception message and > root cause exception. > ------------------------------------------------------------------------------------------------ > > Key: PHOENIX-6185 > URL: https://issues.apache.org/jira/browse/PHOENIX-6185 > Project: Phoenix > Issue Type: Improvement > Components: core > Affects Versions: 4.14.3 > Reporter: Rushabh Shah > Assignee: Viraj Jasani > Priority: Major > > BaseResultIterators#getIterators encountered TimeoutException > [here|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/iterate/BaseResultIterators.java#L1383-L1389] > {code:java} > } catch (TimeoutException e) { > context.getOverallQueryMetrics().queryTimedOut(); > GLOBAL_QUERY_TIMEOUT_COUNTER.increment(); > // thrown when a thread times out waiting for the future.get() > call to return > toThrow = new SQLExceptionInfo.Builder(OPERATION_TIMED_OUT) > .setMessage(". Query couldn't be completed in the > allotted time: " > + queryTimeOut + " > ms").setRootCause(e).build().buildException(); > {code} > It creates SQLExceptionInfo object with message indicating the timeout and > the root cause exception. > But > [SQLExceptionCode#OPERATION_TIMED_OUT#newException|https://github.com/apache/phoenix/blob/master/phoenix-core/src/main/java/org/apache/phoenix/exception/SQLExceptionCode.java#L453-L459] > ignores all that information and creates SQLException with just template > message and loses the root cause exception also. > {code:java} > OPERATION_TIMED_OUT(6000, "TIM01", "Operation timed out.", new Factory() { > @Override > public SQLException newException(SQLExceptionInfo info) { > return new SQLTimeoutException(OPERATION_TIMED_OUT.getMessage(), > OPERATION_TIMED_OUT.getSQLState(), > OPERATION_TIMED_OUT.getErrorCode()); > } > }), > {code} > Instead it should create SQLTimeoutException from SQLExceptionInfo object. -- This message was sent by Atlassian Jira (v8.3.4#803005)