-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[COST-4852] feat: adding an exception to handle TrinoErrors. #5177
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5177 +/- ##
=======================================
- Coverage 94.2% 94.1% -0.0%
=======================================
Files 376 376
Lines 31252 31260 +8
Branches 3734 3736 +2
=======================================
+ Hits 29426 29427 +1
- Misses 1163 1169 +6
- Partials 663 664 +1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might just be me miss-understanding, but I don't fully grasp the changes. To me it looks like we added a new exception for TrinoExternalError
which would already get collected by the generic Exception
no?
Then within that new exception we have additional retry logic?? Is this necessary since we are already rerunning the queries until the retry count is 0 in the generic exception anyway?
The real change here I guess are these lines:
if "NoSuchKey" in str(ex) and attempts_left > 0:
LOG.warning(log_json(msg="file not found, retrying", log_ref=log_ref, context=ctx), exc_info=ex)
To which, would it not make more sense to just put this inside the generic exception?
For example:
except Exception as ex:
if attempts_left == 0:
# Additional if changing the log type based on "NoSuchKey" in str(ex)
Well, I think I didn't get where in the current code and in your suggestion the query would be re-run. We haven't a new call to _execute_trino_raw_sql_query_with_description function here:
That is, when is it going to be called again in this scope (if there are attempts left)? I mean, unless I explicitly put a new call to _execute_trino_raw_sql_query_with_description recursively, it wouldn't call while there are attempts left. |
Jira Ticket
COST-4852
Description
This change will handle the NoSuchKey error on Trino.
Testing
Release Notes