mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
ctdb-scripts: Optimise tickle_tcp_connections()
Pipe the connections to "ctdb tickle" on stdin to avoid having to fork so many "ctdb tickle" processes. This maintains the current level of verbosity at the price of some extra memory usage. Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> Autobuild-User(master): Amitay Isaacs <amitay@samba.org> Autobuild-Date(master): Thu Sep 8 10:45:42 CEST 2016 on sn-devel-144
This commit is contained in:
parent
30c56a0c80
commit
c730f0b337
@ -520,21 +520,12 @@ tickle_tcp_connections ()
|
|||||||
{
|
{
|
||||||
_ip="$1"
|
_ip="$1"
|
||||||
|
|
||||||
get_tcp_connections_for_ip "$_ip" |
|
# Get connections, both directions
|
||||||
{
|
_conns=$(get_tcp_connections_for_ip "$_ip" | \
|
||||||
_failed=false
|
awk '{ print $1, $2 ; print $2, $1 }')
|
||||||
|
|
||||||
while read dest src; do
|
echo "$_conns" | awk '{ print "Tickle TCP connection", $1, $2 }'
|
||||||
echo "Tickle TCP connection $src $dest"
|
echo "$_conns" | ctdb tickle
|
||||||
$CTDB tickle "$src" "$dest" >/dev/null 2>&1 || _failed=true
|
|
||||||
echo "Tickle TCP connection $dest $src"
|
|
||||||
$CTDB tickle "$dest" "$src" >/dev/null 2>&1 || _failed=true
|
|
||||||
done
|
|
||||||
|
|
||||||
if $_failed ; then
|
|
||||||
echo "Failed to send tickle control"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
get_tcp_connections_for_ip ()
|
get_tcp_connections_for_ip ()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user