Fix Pgpool-II hang when used by erlang applications.
authorTatsuo Ishii <ishii@postgresql.org>
Wed, 7 Jun 2017 08:27:54 +0000 (17:27 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Wed, 7 Jun 2017 08:27:54 +0000 (17:27 +0900)
Erlang client sends "Describe" message followed by "Flush".  So the
backend returns "Row description." However Pgpool-II forgets to reset
the query in progress flag upon receiving "Row description" message,
then Pgpool-II keeps on waiting for response from backend. This is the
cause of erlang client hanging.

Fix is, just reset the query in progress flag upon receiving "Row
description" message. Same thing can be said to "no data" message.

Discussion: [pgpool-general: 5555]
http://www.pgpool.net/pipermail/pgpool-general/2017-June/005613.html

src/protocol/pool_proto_modules.c

index 833d0c3ca55a51446dedf5acffaf1f4612b6340e..073a3c074dbf4d6e859143d9249a73201672d0b4 100644 (file)
@@ -2714,13 +2714,13 @@ POOL_STATUS ProcessBackendResponse(POOL_CONNECTION *frontend,
 
                        case 'T':       /* RowDescription */
                                status = SimpleForwardToFrontend(kind, frontend, backend);
-                               if ((REPLICATION || RAW_MODE) && pool_is_doing_extended_query_message())
+                               if (pool_is_doing_extended_query_message())
                                        pool_unset_query_in_progress();
                                break;
 
                        case 'n':       /* NoData */
                                status = SimpleForwardToFrontend(kind, frontend, backend);
-                               if ((REPLICATION || RAW_MODE) && pool_is_doing_extended_query_message())
+                               if (pool_is_doing_extended_query_message())
                                        pool_unset_query_in_progress();
                                break;