-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Fix Client Table #2880
Fix Client Table #2880
Changes from all commits
7a36c47
90e2f4c
8a1b614
0dc424a
f729e6f
6afeb4c
8123dc2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -508,10 +508,12 @@ def client_table(self): | |
if message is None: | ||
return [] | ||
|
||
node_info = [] | ||
node_info = {} | ||
gcs_entry = ray.gcs_utils.GcsTableEntry.GetRootAsGcsTableEntry( | ||
message, 0) | ||
|
||
# Since GCS entries are append-only, we override so that | ||
# only the latest entries are kept. | ||
for i in range(gcs_entry.EntriesLength()): | ||
client = ( | ||
ray.gcs_utils.ClientTableData.GetRootAsClientTableData( | ||
|
@@ -522,8 +524,18 @@ def client_table(self): | |
client.ResourcesTotalCapacity(i) | ||
for i in range(client.ResourcesTotalLabelLength()) | ||
} | ||
node_info.append({ | ||
"ClientID": ray.utils.binary_to_hex(client.ClientId()), | ||
client_id = ray.utils.binary_to_hex(client.ClientId()) | ||
|
||
# If this client is being removed, then it must | ||
# have previously been inserted, and | ||
# it cannot have previously been removed. | ||
if not client.IsInsertion(): | ||
assert client_id in node_info, "Client removed not found!" | ||
assert node_info[client_id]["IsInsertion"], ( | ||
"Unexpected duplicate removal of client.") | ||
|
||
node_info[client_id] = { | ||
"ClientID": client_id, | ||
"IsInsertion": client.IsInsertion(), | ||
"NodeManagerAddress": decode(client.NodeManagerAddress()), | ||
"NodeManagerPort": client.NodeManagerPort(), | ||
|
@@ -532,8 +544,8 @@ def client_table(self): | |
client.ObjectStoreSocketName()), | ||
"RayletSocketName": decode(client.RayletSocketName()), | ||
"Resources": resources | ||
}) | ||
return node_info | ||
} | ||
return list(node_info.values()) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a list is probably the right structure to return, though I'm not sure. A map from I think this is fine for now. This should work in the setting where we have multiple raylets per node, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this works in the setting where we have multiple raylets per node (although it doesn't work when the raylets per node are removed ;) #2878) I think the |
||
|
||
def log_files(self): | ||
"""Fetch and return a dictionary of log file names to outputs. | ||
|
This comment was marked as resolved.
Sorry, something went wrong.