pgpool2.git / summary / log / commit / refs

commit    fb0800e3f0211ba833ca05cf506387e4d2a279b8
Author:   Tatsuo Ishii <ishii@sraoss.co.jp>
Date:     Wed Sep 13 08:51:21 2023 +0000

    Test: attempt to fix 001.load_balance test timeout.
    
    Examining the log reveals that the error was caused by bind error:
    address already used.  This is strange because SO_REUSEADDR flags is
    set to the listening socket.  I guess the cause is, the kernel is not
    fast enough to clean up the socket used by previous pgpool process.
    To fix this, existing CHECK_TIME_WAIT environment variable parameter
    is modified so that it checks the socket by using netstat -tulpn,
    rather than netstat -a, which is too slow.


src/test/pgpool_setup.in | 2 +- src/test/regression/tests/001.load_balance/test.sh | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/test/pgpool_setup.in b/src/test/pgpool_setup.in index 879d02d80..3823d85f2 100644 --- a/src/test/pgpool_setup.in +++ b/src/test/pgpool_setup.in @@ -1320,7 +1320,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 && while [ -f $dir/run/pgpool.pid ];do sleep 1;done' >> $SHUTDOWNALL if [ $CHECK_TIME_WAIT != "false" ];then - echo "while netstat -a|grep $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL + echo "while netstat -tulpn 2>/dev/null|grep pgpool|grep -w $ORIGBASEPORT ;do sleep 1;done" >> $SHUTDOWNALL fi chmod 755 $SHUTDOWNALL echo 'dir=`pwd`' > $PGPOOL_RELOAD diff --git a/src/test/regression/tests/001.load_balance/test.sh b/src/test/regression/tests/001.load_balance/test.sh index 20262a178..c3bad5482 100755 --- a/src/test/regression/tests/001.load_balance/test.sh +++ b/src/test/regression/tests/001.load_balance/test.sh @@ -8,6 +8,7 @@ PSQL=$PGBIN/psql PSQLOPTS="-a -q -X" PGPOOLBIN=$PGPOOL_INSTALL_DIR/bin export PGDATABASE=test +export CHECK_TIME_WAIT=true # sleep time after reload in seconds st=10 [parent: d8d288776a72]