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] Revert to double-spawning updater threads #5903

Merged
merged 3 commits into from
Oct 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
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
15 changes: 13 additions & 2 deletions python/ray/autoscaler/autoscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,11 +553,22 @@ def _update(self):
nodes = self.workers()
self.log_info_string(nodes, target_workers)

# Update nodes with out-of-date files
# Update nodes with out-of-date files.
# TODO(edoakes): Spawning these threads directly seems to cause
# problems. They should at a minimum be spawned as daemon threads.
# See https://github.com/ray-project/ray/pull/5903 for more info.
T = []
for node_id, commands, ray_start in (self.should_update(node_id)
for node_id in nodes):
if node_id is not None:
self.spawn_updater(node_id, commands, ray_start)
T.append(
threading.Thread(
target=self.spawn_updater,
args=(node_id, commands, ray_start)))
for t in T:
t.start()
for t in T:
t.join()

# Attempt to recover unhealthy nodes
for node_id in nodes:
Expand Down
6 changes: 3 additions & 3 deletions python/ray/autoscaler/updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,9 @@ def do_update(self):

node_tags = self.provider.node_tags(self.node_id)
if node_tags.get(TAG_RAY_RUNTIME_CONFIG) == self.runtime_hash:
logger.info(
"NodeUpdater: {} already up-to-date, skip to ray start".format(
self.node_id))
logger.info(self.log_prefix +
"{} already up-to-date, skip to ray start".format(
self.node_id))
else:
self.provider.set_node_tags(
self.node_id, {TAG_RAY_NODE_STATUS: STATUS_SYNCING_FILES})
Expand Down