Skip to content

Added RetryUtil for failing task in case of non-retriable SQL Exceptions#1595

Open
KGaneshDatta wants to merge 2 commits into10.9.xfrom
kdatta_retry_sql_exception_patch1
Open

Added RetryUtil for failing task in case of non-retriable SQL Exceptions#1595
KGaneshDatta wants to merge 2 commits into10.9.xfrom
kdatta_retry_sql_exception_patch1

Conversation

@KGaneshDatta
Copy link
Contributor

@KGaneshDatta KGaneshDatta commented Dec 1, 2025

Problem

Added the Retry Logic to fail the connector in case non-retriable SQLExceptions.

Solution

Does this solution apply anywhere else?
  • yes
  • no
If yes, where?

Test Strategy

Testing done:
  • Unit tests
  • Integration tests
  • System tests
  • Manual tests

Release Plan

@KGaneshDatta KGaneshDatta requested a review from a team as a code owner December 1, 2025 06:35
@confluent-cla-assistant
Copy link

🎉 All Contributor License Agreements have been signed. Ready to merge.
Please push an empty commit if you would like to re-run the checks to verify CLA status for all contributors.

@sonarqube-confluent
Copy link

Quality Gate failed Quality Gate failed

Failed conditions
76.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

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,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You intent to log table or querier ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trim sqle ?

return true;
}
if (cannotRetry(se)) {
return false;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a very specific case. Could there be other such cases ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants