Permalink
Browse files

alter ltclient so that it waits a random amount of time (0 - 30s) bef…

…ore checking on completion. This helps prevent all the nodes from SSHing in at the same time
  • Loading branch information...
1 parent 242d986 commit 0cd5f914c57bdf485e4798da000c90009aaaed3e BuzzTroll committed Sep 10, 2010
Showing with 4 additions and 2 deletions.
  1. +3 −1 control/bin/ltclient.sh
  2. +1 −1 lantorrent/pylantorrent/daemon.py
View
@@ -17,14 +17,16 @@ fi
# check for an error every 30 seconds.. this may need to be in a decent language
cnt=0
done="False"
+thresh=`expr $RANDOM % 30`
while [ ! -e $localpath ];
do
sleep 1
cnt=`expr $cnt + 1`
# if we have waited 30 seconds verify that there wasnt an error
- if [ $cnt -gt 30 ]; then
+ if [ $cnt -gt $thresh ]; then
echo "ltclient checking in..."
+ thresh=30
cnt=0
out=`ssh -p $port $userhost "$remoteexe" --nonblock --reattach "$rid"`
if [ $? -ne 0 ]; then
@@ -36,7 +36,7 @@ def getrows(con):
def do_it_live(con, rows):
- pylantorrent.log(logging.INFO, "lan torrent daemon setting up to send")
+ pylantorrent.log(logging.INFO, "lan torrent daemon setting up to send %d in a group" % (len(rows))
c = con.cursor()
dests = []

0 comments on commit 0cd5f91

Please sign in to comment.