Skip to content

Commit

Permalink
Made stale offset error non-retriable
Browse files Browse the repository at this point in the history
  • Loading branch information
AdalbertMemSQL committed Jul 26, 2024
1 parent 9d852a7 commit d809ecf
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,19 @@ protected Set<Class<? extends Exception>> communicationExceptions() {
WrongOffsetException.class);
}

protected boolean isRetriable(Throwable throwable) {
if (throwable instanceof SQLException) {
SQLException e = (SQLException) throwable;
if (e.getMessage().contains(
"The requested Offset is too stale. Please re-start the OBSERVE query from the latest snapshot.")
&&
e.getErrorCode() == 2851 &&
e.getSQLState().equals("HY000")
) {
return false;
}
}

return super.isRetriable(throwable);
}
}

0 comments on commit d809ecf

Please sign in to comment.