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

Tatsuo Ishii ishii at sraoss.co.jp
Fri Jul 9 12:22:41 JST 2021


Hi, Daniel,

> 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

Good catch! Thank you for the patch. I have committed it into master,
4.2 stable and 4.1 branches, where the wrong buffering was performed.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list