Skip to content

Commit

Permalink
[Core] Fix broken dashboard worker page (#47714)
Browse files Browse the repository at this point in the history
Signed-off-by: Jiajun Yao <jeromeyjj@gmail.com>
  • Loading branch information
jjyao authored Sep 17, 2024
1 parent 53ecf5b commit 5ca9c66
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions python/ray/dashboard/datacenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,7 @@ async def organize(cls, thread_pool_executor):
node_stats,
)
for worker in workers:
stats = worker.get("coreWorkerStats", {})
if stats:
for stats in worker.get("coreWorkerStats", []):
worker_id = stats["workerId"]
core_worker_stats[worker_id] = stats
node_workers[node_id] = workers
Expand All @@ -113,7 +112,9 @@ def merge_workers_for_node(cls, node_physical_stats, node_stats):
for worker in node_physical_stats.get("workers", []):
worker = dict(worker)
pid = worker["pid"]
worker["coreWorkerStats"] = pid_to_worker_stats.get(pid, {})
core_worker_stats = pid_to_worker_stats.get(pid)
# Empty list means core worker stats is not available.
worker["coreWorkerStats"] = [core_worker_stats] if core_worker_stats else []
worker["language"] = pid_to_language.get(
pid, dashboard_consts.DEFAULT_LANGUAGE
)
Expand Down

0 comments on commit 5ca9c66

Please sign in to comment.