diff mbox

[Branch,~linaro-validation/lava-dispatcher/trunk] Rev 368: workaround fix for TIME_WAIT fast model bustage as discussed in: https://bugs.launchpad.net/lava-...

Message ID 20120813135610.26170.93768.launchpad@ackee.canonical.com
State Accepted
Headers show

Commit Message

Andy Doan Aug. 13, 2012, 1:56 p.m. UTC
------------------------------------------------------------
revno: 368
fixes bug: https://launchpad.net/bugs/1034809
author: Alexander Sack <asac@linaro.org>
committer: Andy Doan <andy.doan@linaro.org>
branch nick: lava-dispatcher
timestamp: Fri 2012-08-10 09:54:27 -0500
message:
  workaround fix for TIME_WAIT fast model bustage as discussed in: https://bugs.launchpad.net/lava-dispatcher/+bug/1034809
  
  here we wait till TIME_WAIT is gone, which will fix that we sometimes cant connect adb after rebooting fastmodel.
  
  see https://code.launchpad.net/~asac/lava-dispatcher/logged-commands-getstatusoutput-wrapper-util/+merge/119029 for prereq merge proposal.
modified:
  lava_dispatcher/client/fastmodel.py


--
lp:lava-dispatcher
https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk

You are subscribed to branch lp:lava-dispatcher.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_dispatcher/client/fastmodel.py'
--- lava_dispatcher/client/fastmodel.py	2012-08-08 22:26:59 +0000
+++ lava_dispatcher/client/fastmodel.py	2012-08-10 14:54:27 +0000
@@ -28,6 +28,7 @@ 
 import shutil
 import stat
 import threading
+import time
 
 from lava_dispatcher.client.base import (
     CommandRunner,
@@ -236,6 +237,11 @@ 
         self._fix_perms()
         sim_cmd = self._get_sim_cmd()
 
+        logging.info('ensuring ADB port is ready')
+        while logging_system("sh -c 'netstat -an | grep 5555.*TIME_WAIT'") == 0:
+            logging.info ("waiting for TIME_WAIT 5555 socket to finish")
+            time.sleep(3)
+
         # the simulator proc only has stdout/stderr about the simulator
         # we hook up into a telnet port which emulates a serial console
         logging.info('launching fastmodel with command %r' % sim_cmd)