[pgpool-committers: 8022] pgpool: Fix occasional hang in COPY FROM.

Tatsuo Ishii ishii at sraoss.co.jp
Thu Sep 16 17:01:05 JST 2021


Fix occasional hang in COPY FROM.

If an error occurs while doing COPY FROM, it was possible the
Pgpool-II waited forever for a response from backend after COPY end
marker was sent from frontend. Pgpool expected a new message arrives
to socket, but it is possible that the message (in this case an error
message) is already in the backend read buffer. The fix is, check the
buffer is empty or not before reading from the socket.  New test case
(07.copy_hang) is also added.

The bug was found by Bo Peng.

Branch
------
V3_6_STABLE

Details
-------
https://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=51c2a12b944bc51b15f4bfc7e34430ee0995b070

Modified Files
--------------
src/protocol/pool_proto_modules.c               | 23 ++++++++---
src/test/regression/tests/076.copy_hang/test.sh | 54 +++++++++++++++++++++++++
2 files changed, 71 insertions(+), 6 deletions(-)



More information about the pgpool-committers mailing list