[Core] Ensure Node._node_labels initializes regardless of connect_only#61618
[Core] Ensure Node._node_labels initializes regardless of connect_only#61618edoakes merged 5 commits intoray-project:masterfrom
Conversation
Signed-off-by: dancingactor <s990346@gmail.com>
There was a problem hiding this comment.
Code Review
This pull request addresses an AttributeError by ensuring the _node_labels attribute of the Node class is consistently initialized across all code paths. The security review found no vulnerabilities. The fix involves moving initialization logic out of a conditional block, and a suggestion has been made to enhance robustness against None values.
…fo['labels'] is None Signed-off-by: dancingactor <s990346@gmail.com>
005b7f0 to
eeff305
Compare
|
@MengjinYan @ryanaoleary PTAL |
Signed-off-by: dancingactor <s990346@gmail.com>
db24f09 to
cec8952
Compare
|
Can we add a test for the |
Signed-off-by: dancingactor <s990346@gmail.com>
Signed-off-by: dancingactor <s990346@gmail.com>
|
I noticed that |
|
I also noticed a potential discrepancy in the label's doc, which says that
But we actually can set labels using ray.init(). For example ray/python/ray/tests/test_node_labels.py Lines 63 to 65 in aabe458 |
Description
This PR ensure
Node._node_labelsinitializes regardless ofconnect_only. The original code only initializesdNode._node_labelswhenconnect_only = trueRelated issues
Closes #61604
Additional information
Verification
Testing Script
Before Fix
After Fix