1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

Make ctdbd restarts in tests more reliable.

This works around potential race conditions in the init script where
the restart operation is not necessarily reliable.  It just wraps the
actual restart in a loop and tries for a successful restart up to 5
times.

Signed-off-by: Martin Schwenke <martin@meltin.net>

(This used to be ctdb commit 3f7a4afa0fcc5825beb89267973939df8cde4999)
This commit is contained in:
Martin Schwenke 2009-07-06 16:40:31 +10:00 committed by Ronnie Sahlberg
parent 4bd8e0d87a
commit 7e1cdac0ab

View File

@ -672,12 +672,18 @@ restart_ctdb ()
fi
echo "..."
if [ -n "$CTDB_NODES_SOCKETS" ] ; then
daemons_stop
daemons_start $CTDB_TEST_NUM_DAEMONS
else
onnode -pq all $CTDB_TEST_WRAPPER _restart_ctdb
fi || return 1
local i
for i in $(seq 1 5) ; do
if [ -n "$CTDB_NODES_SOCKETS" ] ; then
daemons_stop
daemons_start $CTDB_TEST_NUM_DAEMONS
else
onnode -p all $CTDB_TEST_WRAPPER _restart_ctdb
fi && break
echo "That didn't seem to work - sleeping a while and trying again..."
sleep_for 5
done
onnode -q 1 $CTDB_TEST_WRAPPER wait_until_healthy || return 1