Deployment open port check should not use login ip (admin_server)
@@ -101,27 +101,29 @@ def wait_for_port_to_open(http_port, operation_id, timeout):
raise OperationTimeout('Operation no longer in cache')
deadline = monotonic.monotonic() + timeout
+ all_lbs = set(appscale_info.get_load_balancer_ips())
+ passed_lbs = set()
while True:
- if monotonic.monotonic() > deadline:
- message = 'Deploy operation took too long.'
- operation.set_error(message)
- raise OperationTimeout(message)
+ for load_balancer in all_lbs:
+ if load_balancer in passed_lbs or monotonic.monotonic() > deadline:
+ continue
- if utils.port_is_open(options.login_ip, http_port):
- break
+ if utils.port_is_open(load_balancer, http_port):
+ passed_lbs.add(load_balancer)
- yield gen.sleep(1)
+ if len(passed_lbs) == len(all_lbs):
+ break
- for load_balancer in appscale_info.get_load_balancer_ips():
- while True:
if monotonic.monotonic() > deadline:
- # The version is reachable from the login IP, but it's not reachable
- # from every registered load balancer. It makes more sense to mark the
+ # If the version is reachable, but it's not reachable from every
+ # registered load balancer. It makes more sense to mark the
# operation as a success than a failure because the lagging load
# balancers should eventually reflect the registered instances.
- break
-
- if utils.port_is_open(load_balancer, http_port):
+ if not passed_lbs:
+ message = 'Deploy operation took too long.'
+ operation.set_error(message)
+ raise OperationTimeout(message)
+ else:
break
yield gen.sleep(1)
