Skip to content

Fix case when cancellation token was requested but query was not canceled #25

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MAF1N
Copy link

@MAF1N MAF1N commented Apr 11, 2025

When you run a command using TrinoCommand with StatementClientV1 internally, there is an issue if you want to cancel the query from execution on server side. The cancelation token is processed in HttpClient at GetResourceAsync, but since the code around the call area is not covered with any try / catch, the flow of termination of command is dropped and the command continues to run on server side. And all this going on while the code requested this command execution is no longer awaiting for result of it. Thus, it is necessary to catch the exception and call cancelation of server execution of specified command.

The code was unreachable here.

With the proposed code change we will cancel the run of command whenever the cancellation requested.

Copy link

cla-bot bot commented Apr 11, 2025

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Mykyta Yarovyi.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email [email protected]
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

Copy link

cla-bot bot commented Apr 11, 2025

Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla

@stelmukhov
Copy link
Member

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Apr 19, 2025
Copy link

cla-bot bot commented Apr 19, 2025

The cla-bot has been summoned, and re-checked this pull request!

@MAF1N MAF1N requested a review from georgewfisher April 19, 2025 18:17
@MAF1N MAF1N assigned MAF1N and unassigned MAF1N Apr 29, 2025
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.

2 participants