Skip to content

feat(engines): cancel ongoing query when shutting down postgres connection #263

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
Apr 29, 2025

Conversation

BugenZhao
Copy link
Collaborator

@BugenZhao BugenZhao commented Apr 24, 2025

Otherwise we have to wait for the ongoing query to be finished before shutdown can return, which doesn't seem friendly when handling cancellation from the user.

@BugenZhao BugenZhao requested review from xxchan and Copilot April 24, 2025 05:56
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements an enhancement to cancel an ongoing query when the Postgres connection is shutting down.

  • Added cancellation logic for ongoing queries via the cancel_token() API.
  • Logs a warning if the query cancellation fails.

Signed-off-by: Bugen Zhao <[email protected]>
@BugenZhao BugenZhao merged commit ebaee51 into main Apr 29, 2025
4 checks passed
@BugenZhao BugenZhao deleted the bz/cancel-before-shutdown branch April 29, 2025 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants