[autoscaler] Allow more than 5s from node creation to first heartbeat (#3385)

This commit is contained in:
Eric Liang
2018-11-26 17:25:05 -08:00
committed by Robert Nishihara
parent 0f0099fb90
commit aa94d3dd50
+4 -2
View File
@@ -491,8 +491,10 @@ class StandardAutoscaler(object):
def recover_if_needed(self, node_id):
if not self.can_update(node_id):
return
last_heartbeat_time = self.load_metrics.last_heartbeat_time_by_ip.get(
self.provider.internal_ip(node_id), 0)
key = self.provider.internal_ip(node_id)
if key not in self.load_metrics.last_heartbeat_time_by_ip:
self.load_metrics.last_heartbeat_time_by_ip[key] = time.time()
last_heartbeat_time = self.load_metrics.last_heartbeat_time_by_ip[key]
delta = time.time() - last_heartbeat_time
if delta < AUTOSCALER_HEARTBEAT_TIMEOUT_S:
return