Changeset: 972ad9966710 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=972ad9966710
Modified Files:
        testing/Mtest.py.in
Branch: Jun2016
Log Message:

If too many TIME_WAIT sockets is the problem, check for that problem.
If a server fails to start for another reason, we don't want to incur
a 2 minute wait.


diffs (57 lines):

diff --git a/testing/Mtest.py.in b/testing/Mtest.py.in
--- a/testing/Mtest.py.in
+++ b/testing/Mtest.py.in
@@ -2804,14 +2804,17 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                 CollectIt(pSrvr.stdout, SrvrOut)
                 pSrvr.wait()
                 pSrvrTimer.cancel()
-                if returnCode(pSrvr) == 'error':
-                    time.sleep(120)
-                    pSrvr, pSrvrTimer = LaunchIt(Srvr, 
'\nio.printf("\\nReady.\\n");\n', SrvrOut, SrvrErr, TIMEOUT)
-                    ln="dummy"
-                    while 0 < len(ln) and not ln.startswith('Ready.'):
-                        ln=pSrvr.stdout.readline()
-                        SrvrOut.write(ln)
-                        SrvrOut.flush()
+                if returnCode(pSrvr) == 'error' and sys.platform == 'linux2':
+                    x = process.Popen(['netstat', '-an'], stdout = 
process.PIPE, stderr = process.PIPE, universal_newlines = True)
+                    out, err = x.communicate()
+                    if out.count('TIME_WAIT') > 100:
+                        time.sleep(120)
+                        pSrvr, pSrvrTimer = LaunchIt(Srvr, 
'\nio.printf("\\nReady.\\n");\n', SrvrOut, SrvrErr, TIMEOUT)
+                        ln="dummy"
+                        while 0 < len(ln) and not ln.startswith('Ready.'):
+                            ln=pSrvr.stdout.readline()
+                            SrvrOut.write(ln)
+                            SrvrOut.flush()
                 if not ln.startswith('Ready.'):
                     ServerReady = False
 
@@ -2823,15 +2826,18 @@ def DoIt(env, SERVER, CALL, TST, EXT, PR
                     CollectIt(pSrvr.stdout, SrvrOut)
                     pSrvr.wait()
                     pSrvrTimer.cancel()
-                    if returnCode(pSrvr) == 'error':
-                        time.sleep(120)
-                        ServerReady = True
-                        pSrvr, pSrvrTimer = LaunchIt(Srvr, 
'\nio.printf("\\nReady.\\n");\n', SrvrOut, SrvrErr, TIMEOUT)
-                        ln="dummy"
-                        while 0 < len(ln) and not ln.startswith('Ready.'):
-                            ln=pSrvr.stdout.readline()
-                            SrvrOut.write(ln)
-                            SrvrOut.flush()
+                    if returnCode(pSrvr) == 'error' and sys.platform == 
'linux2':
+                        x = process.Popen(['netstat', '-an'], stdout = 
process.PIPE, stderr = process.PIPE, universal_newlines = True)
+                        out, err = x.communicate()
+                        if out.count('TIME_WAIT') > 100:
+                            time.sleep(120)
+                            ServerReady = True
+                            pSrvr, pSrvrTimer = LaunchIt(Srvr, 
'\nio.printf("\\nReady.\\n");\n', SrvrOut, SrvrErr, TIMEOUT)
+                            ln="dummy"
+                            while 0 < len(ln) and not ln.startswith('Ready.'):
+                                ln=pSrvr.stdout.readline()
+                                SrvrOut.write(ln)
+                                SrvrOut.flush()
                     if not ln.startswith('Ready.'):
                         ServerReady = False
 
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to