[pgpool-hackers: 3950] Patch: Fix flushing of nodata messages for describe statement

Daniël van de Giessen daniel at dvdgiessen.nl
Fri Jul 9 08:25:16 JST 2021


Hi,

In the recent 743a69b commit a fix was made for asyncpg (a Python
frontend driver using extended protocol) which had issues with the
response to a describe message not being flushed, causing it to hang
indefinitely. See
https://www.pgpool.net/pipermail/pgpool-general/2021-March/007495.html

I ran into the same issue, only this time when setting up a listener.
This seems to be because while the previous change now flushes for any
received RowDescription message, there is another valid response to a
Describe message, namely, a NoData message which is returned in case
the described statement returns no data.

https://www.postgresql.org/docs/current/protocol-flow.html#PROTOCOL-FLOW-EXT-QUERY
states:
> The response is (...) followed by a RowDescription message (...) or a NoData message if the statement will not return rows

In my case, asyncpg was asking for a description of a "LISTEN"
statement, which does not return rows, and PgPool was not flushing the
NoData message causing asyncpg to hang and eventually error out.

Attached patch fixes this by simply also flushing for NoData messages
similar to the previous fix. I've tested it against the latest 4.2.3
release and as far as I can tell it correctly resolves this issue.

Best regards,

Daniël van de Giessen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fix-describe-nodata-statement.patch
Type: application/octet-stream
Size: 1963 bytes
Desc: not available
URL: <http://www.pgpool.net/pipermail/pgpool-hackers/attachments/20210709/c0fc0d81/attachment.obj>


More information about the pgpool-hackers mailing list