Added RetryUtil for failing task in case of non-retriable SQL Exceptions#1595
Added RetryUtil for failing task in case of non-retriable SQL Exceptions#1595KGaneshDatta wants to merge 2 commits into10.9.xfrom
Conversation
|
🎉 All Contributor License Agreements have been signed. Ready to merge. |
|
Animesh Kumar (akanimesh7)
left a comment
There was a problem hiding this comment.
KGaneshDatta This is very knowledge heavy code. Can you work with cursor to make it better.
One more feedback -- I would prefer to have the capability to retry some error on the basis of the message or error code when something breaks in production. A config would be good. We can never be sure that the implementation we did is full proof. Hence having such a config handy would be very helpful.
In oracle cdc this is -- retry.error.codes config.
| if (!RetryUtil.shouldRetry(sqle)) { | ||
| log.error( | ||
| "Non-retriable SQL exception while running query for table: {}. Failing task.", | ||
| querier, |
There was a problem hiding this comment.
You intent to log table or querier ?
| return true; | ||
| } | ||
| if (cannotRetry(se)) { | ||
| return false; |
There was a problem hiding this comment.
This will end the loop. But we wanted to continue until we find a retriable exception in the chain right ?
| private static boolean isRecoverableAndNotClosed(SQLException se) { | ||
| return se instanceof SQLRecoverableException | ||
| && (se.getMessage() == null | ||
| || !se.getMessage().toUpperCase(Locale.ROOT).contains(CONNECTION_CLOSED_MSG)); |
There was a problem hiding this comment.
Looks like a very specific case. Could there be other such cases ?


Problem
Added the Retry Logic to fail the connector in case non-retriable SQLExceptions.
Solution
Does this solution apply anywhere else?
If yes, where?
Test Strategy
Testing done:
Release Plan