Skip to content

[Serve] Route grpcio registered handlers through proxy - #66502

Merged
abrarsheikh merged 2 commits into
ray-project:masterfrom
XFDG:fix/ray-grpc-registered-handlers-66493-signed
Sep 28, 2026
Merged

abrarsheikh merged 2 commits into
ray-project:masterfrom
XFDG:fix/ray-grpc-registered-handlers-66493-signed

Conversation

@XFDG

@XFDG XFDG commented Sep 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Tests

  • Targeted gRPC utility tests: 5 passed, 11 deselected (grpcio 1.84.0).
  • Ruff check, Ruff format check, and git diff --check passed.
  • The target test module was run with --noconftest because the current source conftest imports an API absent from the installed Ray wheel.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

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 gRPC handler overriding in Ray Serve by introducing a helper method _override_method_handler and adding support for routing grpcio's registered-method handlers via add_registered_method_handlers. It also includes comprehensive unit tests to verify the behavior with different grpcio versions and passthrough services. There are no review comments, so I have no feedback to provide.

@ray-gardener ray-gardener Bot added serve Ray Serve Related Issue community-contribution Contributed by the community labels Sep 26, 2026
@qishengxhe qishengxhe added the go add ONLY when ready to merge, run all tests label Sep 26, 2026
@XFDG
XFDG force-pushed the fix/ray-grpc-registered-handlers-66493-signed branch 2 times, most recently from 2627ec7 to b2ac5d3 Compare September 28, 2026 05:27
@abrarsheikh
abrarsheikh merged commit 1c2bf94 into ray-project:master Sep 28, 2026
6 checks passed
nadongjun pushed a commit to nadongjun/ray that referenced this pull request Oct 6, 2026
…6502)

## Summary
- Route grpcio registered-method handlers through the Ray Serve proxy
while preserving passthrough services.
- Gracefully handle grpcio versions without the registered-handler API;
add a fallback test and skip API-specific tests when unavailable.
- Fixes ray-project#66493. Supersedes ray-project#66494; the original pushed commit was left
unchanged.

## Tests
- Targeted gRPC utility tests: 5 passed, 11 deselected (grpcio 1.84.0).
- Ruff check, Ruff format check, and git diff --check passed.
- The target test module was run with --noconftest because the current
source conftest imports an API absent from the installed Ray wheel.

---------

Signed-off-by: zhaoye <[email protected]>
eicherseiji added a commit that referenced this pull request Nov 21, 2026
## Description

Remove the test-only grpcio pin and regenerate the compiled requirements
and dependency locks. The refreshed locks resolve grpcio 1.85.0 across
supported Python versions.

The pin was added to avoid the grpc.aio performance regression tracked
by grpc/grpc#43092, but Ray's runtime dependency remained unbounded
above. That made CI test a different dependency set from fresh user
installations.

Ray #66493 demonstrated the risk: grpcio 1.84 changed registered method
handling and broke every Serve gRPC request, while CI continued testing
grpcio 1.75/1.76 and missed the regression. The compatibility bug was
fixed in #66502, but retaining the test-only pin would preserve the
coverage gap that allowed it through.

Removing the pin means dependency lock refreshes exercise the grpcio
versions users can actually resolve. The grpcio-tools, grpcio-status,
and grpcio-reflection pins remain because they have separate protobuf
compatibility constraints.

The refreshed dependency exposed one stale documentation expectation.
grpc/grpc#41940 intentionally clears status details for successful RPCs
beginning in grpcio 1.81, so the Serve gRPC guide now attaches details
only to non-OK statuses.

## Related issues

Related to #66493.

## Testing

- `./ci/ci.sh compile_pip_dependencies`
- `./ci/ci.sh compile_pip_dependencies_py314`
- `bazel run //ci/raydepsets:raydepsets -- build --all-configs`
- `bazel run //ci/raydepsets:raydepsets -- build --all-configs --check`
- Pre-commit hooks
- Verified grpcio 1.85.0 imports under Python 3.12
- Verified the only semantic package-version change in generated locks
is grpcio
- Reproduced the successful-RPC status-details behavior across grpcio
1.75 through 1.85 and verified the transition at 1.81
- Ran the Core namespaces documentation example with this PR's Python
3.12 CI wheel and grpcio 1.85 successfully

## Additional information

No duplicate dependency PR was found after searching open Ray PRs for
grpcio pin removal or latest-version testing. #66493 is closed and
provides the motivating compatibility incident.

AI assistance was used to investigate history and CI failures,
regenerate dependency locks, and implement the compatibility update.

---------

Signed-off-by: Seiji Eicher <[email protected]>
Signed-off-by: GitHub <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Serve] gRPC proxy fails every RPC with grpcio >= 1.84 (registered method handlers bypass gRPCGenericServer)

3 participants