Enhance shutdown script of pgpool_setup.
authorTatsuo Ishii <ishii@sraoss.co.jp>
Wed, 17 Jul 2019 07:48:37 +0000 (16:48 +0900)
committerTatsuo Ishii <ishii@sraoss.co.jp>
Fri, 19 Jul 2019 07:40:43 +0000 (16:40 +0900)
I observe occasional regression test failure caused by bind error to
the TCP/IP port.  This fix tries to confirm usage of the TCP/IP port
while executing shutdown script using netstat command.

src/test/pgpool_setup

index a9323599801d4cff0b5579709a43b599f2872ceb..47ccab46ae66f75b9b6053cd05dfd17d2197de75 100755 (executable)
@@ -57,6 +57,7 @@
 # $BASEPORT + 2, $BASEPORT + 3 and so on.
 # pgpool port and pcp_port will be assigned to $BASEPORT and $BASEPORT +1 .
 BASEPORT=${BASEBOPRT:-"11000"}
+ORIGBASEPORT=$BASEPORT
 # PostgreSQL startig port number.
 PGBASEPORT=`expr $BASEPORT + 2`
 # Default number of PostgreSQL database clusters
@@ -695,6 +696,7 @@ echo 'dir=`pwd`' > $SHUTDOWNALL
 echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $SHUTDOWNALL
 echo '$PGPOOL_INSTALL_DIR/bin/pgpool -f $dir/etc/pgpool.conf -m f stop' >> $SHUTDOWNALL
 echo 'while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL
+echo "while  netstat -a|grep $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL
 chmod 755 $SHUTDOWNALL
 echo 'dir=`pwd`' > $PGPOOL_RELOAD
 echo "PGPOOL_INSTALL_DIR=$PGPOOL_INSTALL_DIR" >> $PGPOOL_RELOAD