Repository navigation
[core] Revert server CreateCall creation change #55904 - #59448
Conversation
Signed-off-by: dayshah <[email protected]>
There was a problem hiding this comment.
Code Review
This pull request reverts a change, moving a block of code from HandleRequest back into HandleRequestImpl. This is a good change as it moves potentially blocking operations (like WaitUntilInitialized) off the critical gRPC completion queue polling thread and onto an io_service worker thread. This should improve server responsiveness. I've found a potential data race on the state_ member variable that is accessed by multiple threads without synchronization. Please see my detailed comment.
|
Sure! Let’s revert first. It makes sense to me that for small puts, the bottleneck is the polling speed, and having CreateCall in the polling path actually slows down the polling. For large puts, I’m not sure why there is such a significant time difference. |
Ya I guess the thought is that the polling thread is more the bottleneck than the io service thread, but that's pretty unlikely in realistic ray workloads, but possible in a benchmark. But I still wouldn't expect a 2x difference... it seems pretty extreme. |
…y-project#59448) Signed-off-by: dayshah <[email protected]> Signed-off-by: kriyanshii <[email protected]>
…ight-reads io_context GetClusterId is a lock-free read of an immutable value, but its handler is posted to the single-threaded node_manager_io_context shared with RegisterNode/GetAllNodeInfo/CheckAlive. During mass node registration the loop's queue delay exceeds client deadlines, and DEADLINE_EXCEEDED maps to TimedOut which IsGrpcRetryableStatus deliberately never retries — so every connecting process's cluster-ID fetch dies on a constant-value read (observed as cluster bring-up collapse at 400 nodes). Fix by isolation on an existing axis instead of new dispatch machinery: add a dedicated lightweight_rpc_reads_io_context to GcsServerIOContextPolicy (the GCS's existing mechanism for isolating workloads), and a RPC_SERVICE_HANDLER_CUSTOM_AUTH_IN_IO_CONTEXT macro variant that posts one handler to an explicit io_context (_RPC_SERVICE_HANDLER now delegates with the service's main_service_). GetClusterId is the only opt-in; CheckAlive, which is starved by the same storms, can follow. A slow handler on the dedicated loop hurts only itself — unlike inline dispatch on the gRPC polling thread, which ray-project#55904 tried wholesale and ray-project#59448 reverted for a 2x plasma-put regression. Tests: an rpc-layer test proving a handler bound to a dedicated io_context replies while the service's io_context never runs, and a GCS-layer regression test that blocks the node_manager io_context and asserts a 2s-deadline SyncGetClusterId still succeeds (fails pre-fix). Signed-off-by: xyuzh <[email protected]>
Description
Reverting #55904
If you look at
multi_client_put_calls_Plasma_Storeon master vs. this revert:master - https://buildkite.com/ray-project/release/builds/71968#019b2460-2b3d-42a8-bb3c-3eef1fa779df/567-689
this revert - https://buildkite.com/ray-project/release/builds/71926#019b23c7-63e6-4b80-b2dd-9ea26510baf0/576-698
You'll see a 2x throughput increase due to this. This microbenchmark is just doing
The interesting thing is that for the next test over
single_client_put_gigabyteswhich does:We get a reproducible ~50% improvement with the change.
13s on master, 18s with the revert
This shows that this change does have a significant perf impact, both positive and negative and is probably worth digging into more in the future. Reverting for now though until we have more time to understand why there's a big difference on just puts. (nothing else except these put benchmarks really moved at all...)