-
Notifications
You must be signed in to change notification settings - Fork 7k
Move gcs_callback_types.h to rpc_callback_types.h #58596
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
base: master
Are you sure you want to change the base?
Conversation
c2c9de7 to
63261b9
Compare
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.
Code Review
This pull request refactors gcs_callback_types.h to grpc_callback_types.h, making the callback types more generic by removing the gcs namespace. The changes across the codebase correctly reflect this rename and namespace removal.
My main feedback is to update the comments within the newly renamed grpc_callback_types.h to remove specific references to "GCS", aligning them with the goal of making these types more generic. This will improve code clarity and maintainability.
|
The callbacks in that file are not specific to gRPC. To avoid leaking implementation details of the rpc layer, let's call this |
|
@edoakes Thinks. I'll fix it soon. |
|
Thanks! Could you fix this comment as well |
04821bd to
14586e3
Compare
fbaaccc to
87d8331
Compare
|
I converted it to draft since it's still wip. |
7dcfe82 to
f48d26d
Compare
f0c56ca to
74af556
Compare
| /// during the whole lifetime of client. | ||
| std::unique_ptr<rpc::ClientCallManager> client_call_manager_; | ||
| std::unique_ptr<rpc::RayletClient> raylet_client_; | ||
| InstrumentedIOContextWithThread io_context_; |
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.
It's different from the original design. io_context_ used to be static, so all raylet clients share one io_context_. Now each raylet client creates their own. Consider static it and initialize it only once
Signed-off-by: yuchao-wang <wyc984872769@hotmail.com>
74af556 to
e00d99b
Compare
| /// during the whole lifetime of client. | ||
| std::unique_ptr<rpc::ClientCallManager> client_call_manager_; | ||
| std::unique_ptr<rpc::RayletClient> raylet_client_; | ||
| inline static InstrumentedIOContextWithThread io_context_{"raylet_client_io_service"}; |
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.
Bug: Static member changes io_context initialization timing
The io_context_ was changed from a function-local static to a class-level inline static member. While both create a singleton, the initialization timing differs significantly: function-local static uses lazy initialization (thread starts on first use), whereas class-level inline static uses eager initialization (thread starts during static initialization, before main()). Since InstrumentedIOContextWithThread spawns a thread in its constructor, this change causes a background thread to start before the program's main() function runs, which could cause issues with static initialization order or when the code is used from shared libraries. As noted by the reviewer, this differs from the original design intent.
Additional Locations (1)
jjyao
left 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.
LG. Thanks for the contribution!
| // This is to avoid creating multiple threads for multiple clients in python. | ||
| static InstrumentedIOContextWithThread io_context("raylet_client_io_service"); | ||
| instrumented_io_context &io_service = io_context.GetIoService(); | ||
| instrumented_io_context &io_service = io_context_.GetIoService(); |
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.
Why changing this, seems unrelated to this PR
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.
Ah @sunsetxh is fixing your old comments #57004 (comment)
Description
Move gcs_callback_types.h to rpc_callback_types.h
Related issues
Closes #58597