pgpool2.git / summary / log / commit / refs
commit d1c03f2efa25cc8d633d989d54a0cb1f074e448b
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Sat Mar 26 22:49:53 2016 +0000
Fix pgpool_setup to not confuse log output
Before it simply redirects the stdout and stderr of pgpool process to
a log file. This could cause log contents being garbled or even
missed because of race condition caused by multiple process being
writing concurrently. I and Usama found this while investigating the
regression failure of 004.watchdog.
To fix this, pgpool_setup now generates startall script so that pgpool
now sends stdout/stderr to cat command and cat writes to the log file
(It seems the race condition does not occur when writing to a pipe).
src/test/pgpool_setup | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/test/pgpool_setup b/src/test/pgpool_setup
index c2941e9db..0b07d56c5 100755
--- a/src/test/pgpool_setup
+++ b/src/test/pgpool_setup
@@ -726,9 +726,9 @@ test ! -d log && mkdir log
echo "logdir = '$BASEDIR/log'" >> $CONF
if [ "$PGPOOLDEBUG" = "true" ];then
- echo '$PGPOOL_INSTALL_DIR/bin/pgpool -d -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf > $dir/log/pgpool.log 2>&1 &' >> $STARTALL
+ echo '$PGPOOL_INSTALL_DIR/bin/pgpool -d -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf 2&1 | cat > $dir/log/pgpool.log &' >> $STARTALL
else
- echo '$PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf > $dir/log/pgpool.log 2>&1 &' >> $STARTALL
+ echo '$PGPOOL_INSTALL_DIR/bin/pgpool -D -n -f $dir/etc/pgpool.conf -F $dir/etc/pcp.conf -a $dir/etc/pool_hba.conf 2>&1 | cat > $dir/log/pgpool.log &' >> $STARTALL
fi
# create pcp.conf
[parent: aed958766b7c]