pgpool2.git / summary / log / commit / refs
commit a36819d8a23ba53904aea2424dc89f667b7cc33d
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Mon Jul 09 04:51:24 2012 +0000
Fix wait_for_query_response() not to send param status to frontend if
frontend is NULL. This could happen while processing reset_query_list.
pool_process_query.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/pool_process_query.c b/pool_process_query.c
index d65cd269b..61363e222 100644
--- a/pool_process_query.c
+++ b/pool_process_query.c
@@ -736,10 +736,11 @@ POOL_STATUS send_simplequery_message(POOL_CONNECTION *backend, int len, char *st
}
/*
- * Wait for query response from single node. This checks frontend
- * connection by writing dummy parameter status packet every 30
- * seccond, and if the connection broke, returns error since there's
- * no point in that waiting until backend returns response.
+ * Wait for query response from single node. If frontend is not NULL,
+ * also check frontend connection by writing dummy parameter status
+ * packet every 30 seccond, and if the connection broke, returns error
+ * since there's no point in that waiting until backend returns
+ * response.
*/
POOL_STATUS wait_for_query_response(POOL_CONNECTION *frontend, POOL_CONNECTION *backend, int protoVersion)
{
@@ -763,8 +764,12 @@ POOL_STATUS wait_for_query_response(POOL_CONNECTION *frontend, POOL_CONNECTION *
pool_error("wait_for_query_response: backend error occured while waiting for backend response");
return POOL_END;
}
- else if (status > 0) /* data is not ready */
+ else if (frontend != NULL && status > 0)
{
+ /*
+ * If data from backend is not ready, check frontend connection by sending dummy
+ * parameter status packet.
+ */
if (protoVersion == PROTO_MAJOR_V3)
{
/* Write dummy parameter staus packet to check if the socket to frontend is ok */
[parent: c0fae3d690e5]