Skip to content

Fix zombie $partitions queries left running by SQLAlchemy reflection - #627

Open
hashhar wants to merge 1 commit into
trinodb:masterfrom
hashhar:hashhar/fix-sqlalchemy-partitions-zombie-query
Open

Fix zombie $partitions queries left running by SQLAlchemy reflection#627
hashhar wants to merge 1 commit into
trinodb:masterfrom
hashhar:hashhar/fix-sqlalchemy-partitions-zombie-query

Conversation

@hashhar

@hashhar hashhar commented Aug 14, 2026

Copy link
Copy Markdown
Member

Description

_get_partitions never closes the query result after reading cursor.description, so the underlying query is never cancelled and lingers on the coordinator until it eventually times out on its own. Close the result in a finally block so it's always cancelled, whether or not reading cursor.description succeeds.

Non-technical explanation

Supersedes #608

Release notes

( ) This is not user-visible or docs only and no release notes are required.
(x) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text:

* Fix some things. ({issue}`issuenumber`)

_get_partitions never closes the query result after reading
cursor.description, so the underlying query is never cancelled and
lingers on the coordinator until it eventually times out on its own.
Close the result in a finally block so it's always cancelled, whether
or not reading cursor.description succeeds.

Co-authored-by: viniolivieri <vinicius.olivieri@jampp.com>
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.

1 participant