-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
Trino queries cannot be stopped in SQL Lab #24858
Closed
3 tasks done
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: