[pgpool-hackers: 2388] Removing close() from pool_close()

Tatsuo Ishii ishii at sraoss.co.jp
Tue Jun 13 17:02:26 JST 2017


Currently we call close(2) in pool_close() to close the socket to
either frontend or backend. While poking around PostgreSQL source
code, I found following comment in socket_close() in
backend/libpq/pqcomm.c.

		/*
		 * Formerly we did an explicit close() here, but it seems better to
		 * leave the socket open until the process dies.  This allows clients
		 * to perform a "synchronous close" if they care --- wait till the
		 * transport layer reports connection closure, and you can be sure the
		 * backend has exited.
		 *
(note that libpq also does not issue close() in libpq)

I wonder if the same thing can be said to Pgpool-II. In pool_close()
we have:

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);
:
:

Maybe we should remove close() here? For trial, I removed close() then
did the regression test and confirmed that this does not break the
test.

Comments?
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php
Japanese:http://www.sraoss.co.jp


More information about the pgpool-hackers mailing list