Bug #2155
closedldv-online client should work forever
0%
Description
At the moment because of some computer or network problems ldvnode loses connection and a ldv-online client dies with:
Logger: INFO: NO tasks... Logger: ERROR: VCLIENT: Can't connect to server. Is it really running? java.net.ConnectException: Connection timed out at java.net.PlainSocketImpl.socketConnect(Native Method) ... at org.linuxtesting.ldv.online.vs.client.VClientProtocol.VSGetTask(VClientProtocol.java:40) at org.linuxtesting.ldv.online.vs.client.VClient.main(VClient.java:31)
I assume that first of all the ldv-online client should be automatically restarted if it fails (say, we should check it every 5 minutes). Also it shouldn't shut down in case when server becomes unavailable for some time.
Updated by Evgeny Novikov almost 13 years ago
- Status changed from Open to Resolved
- Published in build set to 435dc6e
Evgeny Novikov wrote:
I assume that first of all the ldv-online client should be automatically restarted if it fails (say, we should check it every 5 minutes).
This was fixed by means of cron script (it checks even every 3 minutes of ldv-online presence):
ldvnode:/home/ldv # crontab -u ldv -l ... */3 * * * * /home/ldv/ldv-online-client-restart.pl >> /home/ldv/cron.log 2>&1
(crontab -u ldv -e - to edit this cron script).
ldv/ldv-online-client-restart.pl is so (I put sources here to know about them):
#!/usr/bin/perl
# Check if there is an ldv online client instance running. Restart if no.
if (!`ps aux | grep vsClient.jar | grep -v grep`)
{
print("ldv-online client died, try to restart it!\n");
`/home/ldv/ldv-new/ldv-tools-inst/bin/ldv_client`
or die("Can't run ldv-online client");
print("ldv-online client is running now!\n");
}
else
{
print("ldv-online client works!\n");
}
After that cron log is so:
ldvnode:/home/ldv # cat /home/ldv/cron.log ldv-online client works! ldv-online client works! ldv-online client works! ldv-online client works! ldv-online client works! ldv-online client died, try to restart it! ldv-online client is running now! ldv-online client died, try to restart it! ldv-online client is running now! ldv-online client died, try to restart it! ldv-online client is running now! ldv-online client died, try to restart it! ldv-online client is running now! ldv-online client died, try to restart it! ldv-online client is running now! ldv-online client died, try to restart it! ldv-online client is running now! ldv-online client works! ldv-online client works!
Also it shouldn't shut down in case when server becomes unavailable for some time.
One can see continuous "ldv-online client died, try to restart it!" messages above, in fact this was because of a bug in ldv-online client:
Exception in thread "main" java.lang.NullPointerException at org.linuxtesting.ldv.online.vs.client.VClientProtocol.VSGetTask(VClientProtocol.java:64) at org.linuxtesting.ldv.online.vs.client.VClient.main(VClient.java:31)
I has fixed it with help of Vadim in commit 435dc6e.
Updated by Evgeny Novikov almost 13 years ago
- Status changed from Resolved to Closed
It really works now forever. I put corresponding scripts into the ldv-meta repository under the directory online.