Skip to content

Cancel current query on cursor.close() #195

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

Merged
merged 2 commits into from
Jul 8, 2022

Conversation

mdesmet
Copy link
Contributor

@mdesmet mdesmet commented Jul 7, 2022

Fixes #84

@cla-bot cla-bot bot added the cla-signed label Jul 7, 2022
def test_close_cursor(trino_connection):
cur = trino_connection.cursor()
cur.execute("SELECT * FROM tpch.sf1.customer")
cur.fetchone() # TODO (https://github.com./trinodb/trino/issues/2683) test with and without .fetchone
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this TODO still relevant ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That particular issue is closed. I have tested the same code when omitting the cur.fetchone() the query is still cancelled, however it is not showing up in the Trino UI. I will remove the comment in a preparatory commit.

@mdesmet mdesmet force-pushed the feature/cancel-query branch from 7605d46 to 9bb1466 Compare July 7, 2022 14:38
@mdesmet mdesmet requested a review from ebyhr July 7, 2022 15:28
@mdesmet mdesmet force-pushed the feature/cancel-query branch from 9bb1466 to 00c4461 Compare July 8, 2022 06:09
@ebyhr ebyhr merged commit ed2203f into trinodb:master Jul 8, 2022
@ebyhr
Copy link
Member

ebyhr commented Jul 8, 2022

Merged, thanks!

@Va1-ha11a
Copy link

@ebyhr started having this problem with Trino installed in docker today, first time ever, never happened since I started the trino container. What should I do to resolve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Closing a Cursor does not cancel the query
4 participants