summaryrefslogtreecommitdiff
path: root/scripts/Util.py
diff options
context:
space:
mode:
authorJose <jose@zeroc.com>2019-09-27 18:10:08 +0200
committerJose <jose@zeroc.com>2019-09-27 18:10:08 +0200
commitae09746caaa378bf104c5bcc0b7b9a284a31f409 (patch)
treecdaefa232464479144d34fe50929ed29dd76fca6 /scripts/Util.py
parenttest/Ice/logger need to restore file permission before cleanup (diff)
downloadice-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.py35
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))