-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
[sqllab] add retries for stop_query #8139
[sqllab] add retries for stop_query #8139
Conversation
Codecov Report
@@ Coverage Diff @@
## master #8139 +/- ##
=========================================
+ Coverage 66.06% 66.2% +0.14%
=========================================
Files 479 479
Lines 22930 22929 -1
Branches 2524 2524
=========================================
+ Hits 15148 15180 +32
+ Misses 7648 7615 -33
Partials 134 134
Continue to review full report at Codecov.
|
@villebro nope. This change handles errors on superset side (main DB with superset's state). While #7611 interacts with data source connections. Let me give an example:
You can reproduce it by running a long query, pressing stop in UI and then checking P.S. I used MySQL as an example, it would work the same for any other data source |
This PR is trying to fix the errors like this:
|
6d0574a
to
be825a4
Compare
be825a4
to
210021f
Compare
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.
Makes sense and added logic looks solid. Also much cleaner and easier to refine down the line with backoff
if need to move to exponential backoff or similar as opposed to using homegrown retry logic. LGTM!
@serenajiang this needs rebasing. |
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.
a couple nits and a couple double checks, but this looks awesome otherwise. Thanks for taking the time to refactor this using backoff
too!
CATEGORY
Choose one
SUMMARY
Used
backoff
module to add retries forstop_query
, which was having issues related to lock timeouts and rollbacks. Also reworkedget_query
to usebackoff
as well.get_query
behavior is the same as before.stop_query
attempts to stop the query five times. If, during the process of stopping, the query completes, it will not set the status of the query to stop. If it fails all 5 retries, it will throw an error (probably the same lock timeout error, but without the stuff about rollbacks because there are now rollbacks).TEST PLAN
tox passes.
stop_query
works as expected locally, but it's hard to reproduce this error, so I can't really tell if it errors less.REVIEWERS
@graceguo-supercat