Fix SELECT on tables with bytea columns hanging in process worker#171
Open
AlexZeitler wants to merge 1 commit intoMaxteabag:mainfrom
Open
Fix SELECT on tables with bytea columns hanging in process worker#171AlexZeitler wants to merge 1 commit intoMaxteabag:mainfrom
AlexZeitler wants to merge 1 commit intoMaxteabag:mainfrom
Conversation
psycopg2 returns memoryview objects for bytea columns which cannot be pickled through multiprocessing.Pipe. The worker's send() silently swallowed the serialization error, leaving the client waiting forever. Convert memoryview to bytes in CursorBasedAdapter.execute_query() before rows are returned, so they can be safely pickled. Fixes Maxteabag#161
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
memoryviewobjects forbyteacolumns which cannot be pickled throughmultiprocessing.Pipesend()silently swallowed the serialization error, leaving the client waiting forever (spinner)memoryviewtobytesinCursorBasedAdapter.execute_query()before rows are returned, so they can be safely pickledTest plan
_sanitize_celland_sanitize_rowpassSELECT * FROM bytea_repro;as single statement — should return 3 rows immediatelySELECT id, name FROM bytea_repro;— should still workFixes #161