[sqllab] Help sqllab forget query history#4833
Conversation
163ddda to
5ea9dd9
Compare
|
I've been meaning to do something like this. I wonder if the state should be altered though, like setting the state to |
|
I agree with @mistercrunch it would be great to change the state in the |
5ea9dd9 to
e47d8a5
Compare
|
Okay, I will change the logic to set all pending or running queries older than 6 hours old to failed. |
Codecov Report
@@ Coverage Diff @@
## master #4833 +/- ##
==========================================
- Coverage 77.09% 77.07% -0.02%
==========================================
Files 44 44
Lines 8551 8558 +7
==========================================
+ Hits 6592 6596 +4
- Misses 1959 1962 +3
Continue to review full report at Codecov.
|
|
@timifasubaa I wonder if |
|
There is a lot of repeated logic with stop_query for the new timedout query logic. |
138dc75 to
ab18e5f
Compare
There was a problem hiding this comment.
This logic should not be in front-end (browser-side).
Query table knows each query started time. it doesn't need front-end sends ajax call to set query state.
when front-end ask a query's status, server side should first check the query's start time, if
- longer than 6 hours old: set it timeout and return timeout state.
- < 6 hours: return its current status.
1ed8142 to
9d2e516
Compare
|
I changed the logic to update the db's sate to timeout before it responds to polls. |
dc1ef37 to
a67faa0
Compare
|
PING Quick update on the state of the logic. Is this backend code worth having? Especially since it may trick people into believing we actually timeout the queries when the query will most likely not be updated to timeout. |
|
current auto query refresh component work like this:
this PR LGTM. but will not merge until @mistercrunch feel comfortable. Thank you! |
There was a problem hiding this comment.
No hard coded values please. Put it in src/SqlLab/constants.js
a67faa0 to
ab958c6
Compare
…e_past [sqllab] Help sqllab forget query history
(cherry picked from commit 2014329)
(cherry picked from commit 03cae41)
(cherry picked from commit 2014329)
…e_past [sqllab] Help sqllab forget query history

In the sqllab asynchronous polling logic, it looks through the query history and continues to poll if there is a query in the history that is not successful.
This PR makes it look only at the last 6 hours of queries when checking for their states. The rationale is that a query that was started 6 hours ago is probably dead or problematic and should be rerun.
@graceguo-supercat @mistercrunch @john-bodley