Move gcs_callback_types.h to rpc_callback_types.h#58596
Move gcs_callback_types.h to rpc_callback_types.h#58596edoakes merged 2 commits intoray-project:masterfrom
Conversation
c2c9de7 to
63261b9
Compare
There was a problem hiding this comment.
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.
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
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.
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.
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.
Why changing this, seems unrelated to this PR
There was a problem hiding this comment.
Ah @sunsetxh is fixing your old comments #57004 (comment)
There was a problem hiding this comment.
Let's separate it out to its own PR.
|
@jjyao How to run python test cases locally |
|
@sunsetxh you can cd to the test file folder and just run |
1a19c01 to
81000df
Compare
|
Test failures |
4cb6167 to
34b6284
Compare
|
Test failures |
b2707ed to
091c40c
Compare
|
Hi @jjyao looks like ray upgraded
|
091c40c to
8dd8e94
Compare
8dd8e94 to
1ea8e17
Compare
Signed-off-by: yuchao-wang <wyc984872769@hotmail.com>
1ea8e17 to
a38ab51
Compare
Signed-off-by: tianyi-ge <tianyig@outlook.com>
|
Hi @jjyao can you take a look? |
|
cc @edoakes for merge. |
## Description Move gcs_callback_types.h to rpc_callback_types.h ## Related issues Closes ray-project#58597 --------- Signed-off-by: tianyi-ge <tianyig@outlook.com> Co-authored-by: tianyi-ge <tianyig@outlook.com> Signed-off-by: DPatel_7 <dpatel@gocommotion.com>
## Description Move gcs_callback_types.h to rpc_callback_types.h ## Related issues Closes ray-project#58597 --------- Signed-off-by: tianyi-ge <tianyig@outlook.com> Co-authored-by: tianyi-ge <tianyig@outlook.com> Signed-off-by: jasonwrwang <jasonwrwang@tencent.com>
## Description Move gcs_callback_types.h to rpc_callback_types.h ## Related issues Closes ray-project#58597 --------- Signed-off-by: tianyi-ge <tianyig@outlook.com> Co-authored-by: tianyi-ge <tianyig@outlook.com>
## Description Move gcs_callback_types.h to rpc_callback_types.h ## Related issues Closes ray-project#58597 --------- Signed-off-by: tianyi-ge <tianyig@outlook.com> Co-authored-by: tianyi-ge <tianyig@outlook.com>


Description
Move gcs_callback_types.h to rpc_callback_types.h
Related issues
Closes #58597