diff options
author | Jose <jose@zeroc.com> | 2019-09-27 18:10:08 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2019-09-27 18:10:08 +0200 |
commit | ae09746caaa378bf104c5bcc0b7b9a284a31f409 (patch) | |
tree | cdaefa232464479144d34fe50929ed29dd76fca6 /scripts/Util.py | |
parent | test/Ice/logger need to restore file permission before cleanup (diff) | |
download | ice-ae09746caaa378bf104c5bcc0b7b9a284a31f409.tar.bz2 ice-ae09746caaa378bf104c5bcc0b7b9a284a31f409.tar.xz ice-ae09746caaa378bf104c5bcc0b7b9a284a31f409.zip |
Retry when discovering the process controller
Diffstat (limited to 'scripts/Util.py')
-rw-r--r-- | scripts/Util.py | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/scripts/Util.py b/scripts/Util.py index 862860e2e50..57856812a41 100644 --- a/scripts/Util.py +++ b/scripts/Util.py @@ -2218,20 +2218,29 @@ class RemoteProcessController(ProcessController): # Use well-known proxy and IceDiscovery to discover the process controller object from the app. proxy = Test.Common.ProcessControllerPrx.uncheckedCast(comm.stringToProxy(comm.identityToString(ident))) - try: - proxy.ice_ping() - with self.cond: - self.processControllerProxies[ident] = proxy - return self.processControllerProxies[ident] - except Exception: - pass - # Wait 60 seconds for a process controller to be registered with the ProcessControllerRegistry - with self.cond: - if not ident in self.processControllerProxies: - self.cond.wait(60) - if ident in self.processControllerProxies: - return self.processControllerProxies[ident] + # + # First try to discover the process controller with IceDiscovery, if this doesn't + # work we'll wait for 10s for the process controller to register with the registry. + # If the wait times out, we retry again. + # + nRetry = 0 + while nRetry < 10: + nRetry += 1 + + try: + proxy.ice_ping() + with self.cond: + self.processControllerProxies[ident] = proxy + return self.processControllerProxies[ident] + except Exception: + pass + + with self.cond: + if not ident in self.processControllerProxies: + self.cond.wait(10) + if ident in self.processControllerProxies: + return self.processControllerProxies[ident] raise RuntimeError("couldn't reach the remote controller `{0}'".format(ident)) |