Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 5 commits into from
Nov 27, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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_by_ip = time.time()
Copy link
Contributor

@mattearllongshot mattearllongshot Nov 22, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line should read self.load_metrics.last_heartbeat_time_by_ip[key] = time.time() (attribute name, and you need the subscript)

last_heartbeat_time = self.load_metrics.last_heartbeat_time_by_ip[key]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this used to default to 0, which means that delta (below) would be enormous and then the autoscaler would attempt to restart the node, right?

delta = time.time() - last_heartbeat_time
if delta < AUTOSCALER_HEARTBEAT_TIMEOUT_S:
return
Expand Down