[Pgpool-general] how to force pgpool to release client connections?

Tatsuo Ishii ishii at sraoss.co.jp
Thu Oct 23 13:53:48 UTC 2008


> Hello,
> 
> I have faced with the problem of "zombie" connections that prevents starting
> the second stage of on-line recovery process.
> The zombie connections are between clients behind the firewall that are
> unexpectedly disapeared.
> The pgpool sends RESEST after client_idle_limit seconds, but if no client
> exists on the remote site this connection is waiting in CLOSE-WAIT state
> till ...

pgpool does not send RESET request to the client, but to the
backend. So your problem seems to be caused by pgpool calling close(2)
the connection to client.

Can you try included patches which try to avoid the problem by using
shutdown(2)?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
-------------- next part --------------
Index: pool_stream.c
===================================================================
RCS file: /cvsroot/pgpool/pgpool-II/pool_stream.c,v
retrieving revision 1.12
diff -c -r1.12 pool_stream.c
*** pool_stream.c	4 Jul 2008 05:27:30 -0000	1.12
--- pool_stream.c	23 Oct 2008 13:51:26 -0000
***************
*** 95,101 ****
--- 95,107 ----
  */
  void pool_close(POOL_CONNECTION *cp)
  {
+ 	/*
+ 	 * shutdown connection to the client so that pgpool is not blocked
+ 	 */
+ 	if (!cp->isbackend)
+ 		shutdown(cp->fd, 1);
  	close(cp->fd);
+ 
  	free(cp->wbuf);
  	free(cp->hp);
  	if (cp->sbuf)


More information about the Pgpool-general mailing list