-
Notifications
You must be signed in to change notification settings - Fork 177
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @findepi is the server supposed to be doing this?
i don't think it is. from the issue
this is concerning a bit. the client protocol is "single threaded", i.e. there is typically exactly one ongoing request. |
39546f7
to
26c9f41
Compare
@@ -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) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
@hashhar : An alternative solution would be to implement the deallocated prepared statements as a |
Description
Resolves #248
X-Trino-Deallocated-Prepare
may appear on multiple responses. Query execution should not fail on prepared statement removal if the prepared statement has already been removed.Release notes
( ) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
(x) Release notes are required, with the following suggested text:
* Fix failure on already removed deallocated prepared statement headers