Skip to content
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

Ignore already removed deallocated prepared statement headers #249

Merged
merged 1 commit into from
Oct 11, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion trino/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ def process(self, http_response) -> TrinoStatus:
for name in get_header_values(
http_response.headers, constants.HEADER_DEALLOCATED_PREPARE
):
self._client_session.prepared_statements.pop(name)
self._client_session.prepared_statements.pop(name, None)
Copy link
Member

Choose a reason for hiding this comment

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

Can we add a debug log or a warnings.warn here since ideally this should not be happenning at all. We should try to collect when this happens and why and fix it.

Copy link
Member

Choose a reason for hiding this comment

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

Useful information to log would be the statement we are trying to deallocate, the current state of the prepared_statements dict and the response headers we received.


self._next_uri = response.get("nextUri")

Expand Down