Skip to content

Commit

Permalink
[autoscaler] fix too many values to unpack (expected 2) bug (ray-proj…
Browse files Browse the repository at this point in the history
…ect#36231)

autoscaler_summary.pending_launches is a dict thus causing the iteration fails with too many values to unpack issue.
  • Loading branch information
scv119 committed Jun 9, 2023
1 parent 4e9b9f9 commit 94a22ca
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions python/ray/autoscaler/_private/monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,15 @@ def _run(self):
self.autoscaler.update()
status["autoscaler_update_time"] = time.time() - update_start_time
autoscaler_summary = self.autoscaler.summary()
self.emit_metrics(
load_metrics_summary,
autoscaler_summary,
self.autoscaler.all_node_types,
)
try:
self.emit_metrics(
load_metrics_summary,
autoscaler_summary,
self.autoscaler.all_node_types,
)
except Exception:
logger.exception("Error emitting metrics")

if autoscaler_summary:
status["autoscaler_report"] = asdict(autoscaler_summary)
status[
Expand Down Expand Up @@ -464,7 +468,7 @@ def emit_metrics(self, load_metrics_summary, autoscaler_summary, node_types):
for _, node_type, _ in autoscaler_summary.pending_nodes:
pending_node_count[node_type] += 1

for node_type, count in autoscaler_summary.pending_launches:
for node_type, count in autoscaler_summary.pending_launches.items():
pending_node_count[node_type] += count

for node_type in node_types:
Expand Down

0 comments on commit 94a22ca

Please sign in to comment.