Uh oh!
There was an error while loading. Please reload this page.
PHOENIX-6185 : Propagate info available in SQLExceptionInfo to SQLTimeoutException - #919
Conversation
stoty
commented
Oct 13, 2020
💔 -1 overall
This message was automatically generated. |
virajjasani
commented
Oct 14, 2020
It's strange that build data is not available on ci-hadoop. Perhaps some clearn up took place? |
virajjasani
commented
Oct 14, 2020
|
stoty
commented
Oct 15, 2020
💔 -1 overall
This message was automatically generated. |
virajjasani
commented
Oct 15, 2020
@gjacoby126 checkstyle is fixed, should be visible in next build. This applies directly to 4.x. Would you like me to create 4.x PR? |
Uh oh!
There was an error while loading. Please reload this page.
shahrs87
left a comment
There was a problem hiding this comment.
just 1 minor comment. other than ltgm.
| (info.getMessage() != null ? info.getMessage() : "") | ||
| + (info.getRootCause() != null ? " , rootCause: " | ||
| + info.getRootCause() : ""); | ||
| return new SQLTimeoutException(reason, |
There was a problem hiding this comment.
Sorry missed this in my previous review.
If there is root cause exception present, you should use this constructor to create SQLtimeoutException
public SQLTimeoutException(String reason,
String SQLState,
int vendorCode,
Throwable cause)
| assertEquals(OPERATION_TIMED_OUT.getErrorCode(), | ||
| e.getErrorCode()); | ||
| assertTrue(e.getMessage().contains("Query couldn't be " + | ||
| "completed in the allotted time: 5000 ms")); |
There was a problem hiding this comment.
Should we check that e.getCause() != null ?
There was a problem hiding this comment.
Actually it is null in this case because for the test, rootCause is not provided here (BaseResultIterators):
throw new SQLExceptionInfo.Builder(OPERATION_TIMED_OUT).setMessage(
". Query couldn't be completed in the allotted time: "
+ queryTimeOut + " ms").build().buildException();
However, I tested by manually adding rootCause and receiving on test side. Hence, it is working fine but since relevant source code does not add root cause, e.getCause() != null would not be true here.
There was a problem hiding this comment.
@virajjasani Can we just write a unit test creating OPERATION_TIMED_OUT exception with custom message and custom fake exception. Ideally we wouldn't even need integration test but the test that you wrote is very nice.
There was a problem hiding this comment.
Done. Let's keep both unit and IT.
Thanks
stoty
commented
Oct 15, 2020
💔 -1 overall
This message was automatically generated. |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
+1 ltgm pending jenkins run. Thank you @virajjasani for fixing nitty comments. :)
stoty
commented
Oct 15, 2020
💔 -1 overall
This message was automatically generated. |
…eoutException (#919) PHOENIX-6185 : Propagate info available in SQLExceptionInfo to OPERATION_TIMED_OUT
No description provided.