[sql lab] Fix new query stuck at pending state #7523
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
CATEGORY
Choose one
SUMMARY
I found a very strange corner case: some user didn't use sql lab for a long time, and they didn't have any old query tab in Sql Lab. When recently they started to use sql lab, their async query may stuck at pending state forever. From browser console I can see the query was sent to back end, but browser didn't start polling query results at all. So that even backend finished query, front end is still showing pending state. This issue can't be consistently reproduced, it only happened on few users, but those users are totally blocked and can't run any async queries successfully.
After debug I found polling was stopped by this line:
For those users got stuck at pending state, when sql lab was initialized,
queriesLastUpdate
was 0. There was a change for initial value introduced in #5896.queriesLastUpdate
was set to 0 before this PR. So i am thinking probably those users' sql lab state was persisted into localStorage. And now they open sql lab with new code base that requiresqueriesLastUpdate > 0
, then their sql lab can't poll anymore.I don't think
queriesLastUpdate > 0
is really necessary for polling query results. So my solution for this issue is just remove this requirement.TEST PLAN
ci and check with users stuck at pending state.
ADDITIONAL INFORMATION
REVIEWERS
@williaster @michellethomas