Skip to content
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

execute_with_retry() error handling improvements [VS-159] #7480

Merged
merged 11 commits into from
Sep 29, 2021

Conversation

rsasch
Copy link

@rsasch rsasch commented Sep 21, 2021

Closes https://broadworkbench.atlassian.net/browse/VS-159

  • move execute_with_retry to utils so that only defined in one place
  • add more specific error handling

NOTE for reviewers: you probably want to check "Hide whitespace changes" under settings because IntelliJ did some "helpful" cleanup when I made some code changes to files.

@rsasch rsasch changed the title execute_with_retry() improvements execute_with_retry() improvements [VS-159] Sep 21, 2021
@rsasch rsasch changed the title execute_with_retry() improvements [VS-159] execute_with_retry() error handling improvements [VS-159] Sep 22, 2021
@kcibul
Copy link
Contributor

kcibul commented Sep 27, 2021

Overall the refactoring looks good and makes sense… but I'm not seeing how this fixes the problem of eating exceptions we saw during a recent run. Can you explain what was happening before, and how the new code addresses it?

@rsasch
Copy link
Author

rsasch commented Sep 29, 2021

Overall the refactoring looks good and makes sense… but I'm not seeing how this fixes the problem of eating exceptions we saw during a recent run. Can you explain what was happening before, and how the new code addresses it?

Sure! This code (besides refactoring so that it was only in one place) aims to fix two issues:

  1. if query results in an error, it gets run three more times and then, because of while len(retry_delay) > 0, it doesn’t run again and the raise err line never gets executed, so no error is ever raised
  2. if the query fails for a reason that has no chance of being fixed by a retry (eg. 404), it will still run three more times

I probably missed some errors that should be "retry-able" (maybe Aborted ? BadGateway? Cancelled ? full list here), but I still think it makes sense to not treat all errors the same.

@rsasch rsasch requested a review from kcibul September 29, 2021 14:43
Copy link
Contributor

@kcibul kcibul left a comment

Choose a reason for hiding this comment

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

lgtm!

@rsasch rsasch merged commit 6e6bb01 into ah_var_store Sep 29, 2021
@rsasch rsasch deleted the rsa_handle_prepare_error branch September 29, 2021 18:50
This was referenced Mar 17, 2023
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