Author Topic: PTSMINER-WATCHDOG (updated) | "force reconnect if possible!" errors  (Read 5090 times)

0 Members and 1 Guest are viewing this topic.

Offline xolokram

  • Sr. Member
  • ****
  • Posts: 239
  • beeeeer.org
    • View Profile
Re: PTSMINER-WATCHDOG | "force reconnect if possible!" errors
« Reply #2 on: November 11, 2013, 02:55:38 pm »
yup, someone (and in the end this means: xolokram ) has to re-code the connection management. it got bloated for historical reasons. :(

anyway, nice script.

- xolokram
stats for pts@beeeeer.org
BTC: 1S4kxaF4ro17qThUz4hQwAoiXzCWdzwdb | LTC: LMgYASNbAgGUG6fhw1xdMAWSbMiWjNNGgo
XPM: AJhA1PGbNM94ZmsJvVVM5FfbE9SdxiMzgd | PTS: PbfspbvSWxYqrp3DpRH7bsrmEqzY3418Ap

Offline yago

  • Full Member
  • ***
  • Posts: 188
    • View Profile
PTSMINER-WATCHDOG (updated) | "force reconnect if possible!" errors
« Reply #1 on: November 11, 2013, 12:59:51 pm »
Not sure why, but got those "force reconnect if possible!" errors.

Found a post by xolokram @ peercointalk that says:

Quote
"the typical behaviour for the miner when the connection is lost is to continue mining for 5 minutes (this is when the "force reconnect if possible!" log line appears) and when a thread finds a share during this period, the thread waits until the connection is back again to submit it. unfortunately the triggers are not always working correctly (the current implementation is a bit 'clunky' regarding connection loss) and a thread continues mining forever on the old block. especially when you have unstable connections or partly blocked connections or any behaviour that's far off from (let's say) "normal".
http://www.peercointalk.org/index.php?topic=501.240

I've just made a simple software watchdog that restarts ptsminer if detects a "force reconnect" error. Just change the folder, pooluser and genproclimit to mine @ beer pool.

Edit: Added proper process killing with Ctrl-C and move old log to ~/ptsminer.log.old

Code: [Select]
#!/bin/bash

#Tips welcome :) PYfnvSc9CRHCebGDtVkSijo6k7pCbpPthX

function launchptsminer {
echo "######## Starting ptsminer... ########"
cd ~/src/ptsminer/src/
./ptsminer -poolip=ptsmine.beeeeer.org -poolport=1337 -poolpassword=0 -pooluser=PYfnvSc9CRHCebGDtVkSijo6k7pCbpPthX -genproclimit=4 > ~/ptsminer.log &
}

control_c()
{
echo "######## Stopping  ########"
ps aux | grep tail | grep ptsminer | awk  '{print "kill "$2}' | sh
killall ptsminer
exit 0
}
 
trap control_c SIGINT

mv ~/ptsminer.log ~/ptsminer.log.old 2> /dev/null

launchptsminer

tail -f ~/ptsminer.log &

while true
do
grep "force reconnect" ~/ptsminer.log
if [ $? -eq 0 ]
then
echo "######## Force reconnect DETECTED ########"
echo "######## Killing ptsminer... ########"
killall ptsminer
echo "######## Wait 5 secs... ########"
sleep 5s
launchptsminer
fi
sleep 1s
done
« Last Edit: November 11, 2013, 08:27:59 pm by yago »
http://bitsharestalk.org/donate.html  <---- Donate to the BitShares Forum ----> PforumPLfVQXTi4QpQqKwoChXHkoHcxGuA