You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trino queries do not get stopped in SQL Lab when hitting the STOP button.
How to reproduce the bug
Configure a trino backend
Run a query against trino, ideally one which takes a few minutes to execute
Hit stop
See the query continue to run (observe logs or check trino interface)
Expected results
Query should be stopped after hitting the stop button.
Actual results
It continues to run until completion
Environment
(please complete the following information):
browser type and version: N/A
superset version: 2.1
python version: N/A
node.js version: N/A
any feature flags active:
trino==0.324.0 but applies to other versions too
Checklist
Make sure to follow these steps before submitting your issue - thank you!
I have checked the superset logs for python stacktraces and included it here as text if there are any.
I have reproduced the issue with at least the latest released version of superset.
I have checked the issue tracker for the same issue and I haven't found one similar.
Additional context
We've done some additional investigating into why this happens and we're ready to raise a draft PR which I'll attach to this issue. The bottom line is that the trino client doesn't have an async mode, and the query execution call will simply block until the query completes. This means the handle_cursor call we do is useless because we only extract query ID and/or trigger early cancellation events on the query after it's finished, when it's too late.
As a draft fix I've fired the query off in another thread manually and polled for the query ID to be appear asynchronously, and the rest of the stop query code seems to work fine with that in place. See PR.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Trino queries do not get stopped in SQL Lab when hitting the STOP button.
How to reproduce the bug
Expected results
Query should be stopped after hitting the stop button.
Actual results
It continues to run until completion
Environment
(please complete the following information):
2.1
trino==0.324.0
but applies to other versions tooChecklist
Make sure to follow these steps before submitting your issue - thank you!
Additional context
We've done some additional investigating into why this happens and we're ready to raise a draft PR which I'll attach to this issue. The bottom line is that the trino client doesn't have an async mode, and the query execution call will simply block until the query completes. This means the
handle_cursor
call we do is useless because we only extract query ID and/or trigger early cancellation events on the query after it's finished, when it's too late.As a draft fix I've fired the query off in another thread manually and polled for the query ID to be appear asynchronously, and the rest of the stop query code seems to work fine with that in place. See PR.
The text was updated successfully, but these errors were encountered: