Fix yet another reset query stuck problem.
authorTatsuo Ishii <ishii@postgresql.org>
Thu, 24 Jul 2014 06:40:51 +0000 (15:40 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Thu, 24 Jul 2014 06:40:51 +0000 (15:40 +0900)
If client_idle_limit is set and the idle limit reaches,
pool_process_query() returns and tries to execute reset query which
may not be acceptable by backend because it may not be in "ready for
query" state. The fix is, close connections to backend instead.

Per bug#107.

pool_process_query.c

index 8f07bbd59ee7ab2120eda29e69fc2527e17c2198..9e4358d685ed3006d05a22c4472d643f5ccdd1c1 100644 (file)
@@ -5,7 +5,7 @@
  * pgpool: a language independent connection pool server for PostgreSQL
  * written by Tatsuo Ishii
  *
- * Copyright (c) 2003-2013     PgPool Global Development Group
+ * Copyright (c) 2003-2014     PgPool Global Development Group
  *
  * Permission to use, copy, modify, and distribute this software and
  * its documentation for any purpose and without fee is hereby
@@ -266,7 +266,7 @@ POOL_STATUS pool_process_query(POOL_CONNECTION *frontend,
                                                pool_send_error_message(frontend, MAJOR(backend),
                                                                                                "57000", "connection terminated due to client idle limit reached",
                                                                                                "","",  __FILE__, __LINE__);
-                                               return POOL_END;
+                                               return POOL_END_WITH_FRONTEND_ERROR;
                                        }
                                }
                                else if (*InRecovery > 0 && pool_config->client_idle_limit_in_recovery > 0)