From 44ccca1acb526698f4400426154a5bdac7c1da0e Mon Sep 17 00:00:00 2001 From: Tao Wang Date: Mon, 27 Jul 2020 11:23:06 +0800 Subject: [PATCH] Only update raylet map when autoscaler configured (#9435) --- python/ray/monitor.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/ray/monitor.py b/python/ray/monitor.py index 51f19ea1f..ab830bcb6 100644 --- a/python/ray/monitor.py +++ b/python/ray/monitor.py @@ -214,6 +214,9 @@ class Monitor: This function loops forever, checking for messages about dead database clients and cleaning up state accordingly. """ + # Initialize the mapping from raylet client ID to IP address. + self.update_raylet_map() + # Initialize the subscription channel. self.psubscribe(ray.gcs_utils.XRAY_HEARTBEAT_BATCH_PATTERN) self.psubscribe(ray.gcs_utils.XRAY_JOB_PATTERN) @@ -227,12 +230,10 @@ class Monitor: # Handle messages from the subscription channels. while True: - # Update the mapping from raylet client ID to IP address. - # This is only used to update the load metrics for the autoscaler. - self.update_raylet_map() - # Process autoscaling actions if self.autoscaler: + # Only used to update the load metrics for the autoscaler. + self.update_raylet_map() self.autoscaler.update() # Process a round of messages.