-
Notifications
You must be signed in to change notification settings - Fork 6k
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
[core] Switch Async Callback to C++ [WIP] #9228
Conversation
Can one of the admins verify this patch? |
Test FAILed. |
Test FAILed. |
@ijrsvt looks great! Could you make a full PR that removes the old code? |
Test FAILed. |
Test PASSed. |
Test PASSed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is awesome!!!
src/ray/core_worker/core_worker.h
Outdated
using PlasmaSubscriptionCallback = std::function<void(ray::ObjectID, int64_t, int64_t)>; | ||
|
||
/// Set callback when an item is added to the plasma store. | ||
/// Perform async get from in-memory store. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this also does retrying?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean? in terms of fetching from Plasma?
absl::flat_hash_map<ObjectID, std::vector<std::function<void(void)>>> | ||
async_plasma_callbacks_ GUARDED_BY(plasma_mutex_); | ||
|
||
void PlasmaCallback(SetResultCallback success, std::shared_ptr<RayObject> ray_object, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlasmaCallback needs a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to confirm, this handler is for GetAsync falling back to plasma?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep!
if (Get(std::vector<ObjectID>{object_id}, 0, &vec).ok() && vec.size() > 0) { | ||
return success(vec.front(), object_id, py_future); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this case for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any case where the object is immediately available, but not in Memory. Calling before subscribe avoids filling subscribe with unnecessary object ids.
Test FAILed. |
Test PASSed. |
Test FAILed. |
Test PASSed. |
Why are these changes needed?
The current implementation of Async functionality for ObjectIDs is confusing and spread out between C++ and Python. This PR moves as much logic as possible into C++.
Related issue number
Closes #9251
Supercedes #9161
Checks
scripts/format.sh
to lint the changes in this PR.