Skip to content

Commit

Permalink
[autoscaler] Allow more than 5s from node creation to first heartbeat (
Browse files Browse the repository at this point in the history
  • Loading branch information
ericl authored and robertnishihara committed Nov 27, 2018
1 parent 0f0099f commit aa94d3d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions python/ray/autoscaler/autoscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,10 @@ def files_up_to_date(self, node_id):
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
Expand Down

0 comments on commit aa94d3d

Please sign in to comment.