Repository navigation
[build] Bazel 8.8.1: bump protobuf to v29.6, rules_java to 8.12.0 and gRPC to 1.69.0 - #66483
elliot-barn wants to merge 12 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request upgrades Protobuf to v29.6, gRPC to v1.69.0, and Abseil to 20240722.0, along with updating rules_java, rules_cc, and bazel_skylib to ensure compatibility with Bazel 8. It also introduces tracking of in-flight RPC calls in GrpcClient to prevent channels from being prematurely marked as idle. Feedback on the changes highlights a critical race condition in GrpcClient where decrementing the in-flight call counter before executing the user callback could lead to premature client eviction or destruction while the callback is still running.
| num_calls_in_flight->fetch_sub(1); | ||
| user_callback(status, std::move(reply)); |
There was a problem hiding this comment.
Decrementing num_calls_in_flight before invoking user_callback can allow the client to be detected as idle and evicted/destroyed by another thread (e.g., the client pool) while user_callback is still executing. If the callback accesses any resources associated with the client, this could lead to a use-after-free or race condition.
Invoking user_callback first and then decrementing the counter ensures that the client is kept alive and not considered idle until the callback has fully finished executing.
| num_calls_in_flight->fetch_sub(1); | |
| user_callback(status, std::move(reply)); | |
| user_callback(status, std::move(reply)); | |
| num_calls_in_flight->fetch_sub(1); |
There was a problem hiding this comment.
Agreed, fixed in 0c06a11: the callback now runs first and the in-flight count is decremented after it, so the client cannot look idle (and be evicted from CoreWorkerClientPool) while it is still handling the reply. //src/ray/rpc/tests:grpc_server_client_test (including TestNotIdleWhileCallInFlight) and //src/ray/core_worker_rpc_client/tests:core_worker_client_pool_test pass.
d96817d to
b82fc29
Compare
Release perf benchmarksAll 13 core perf release tests (AWS) passed on Compared against the 2.59.0 baselines in
Two metrics are worse than 2.59.0, but master nightly already shows the same values without this PR:
Premerge is fully green with every manual gate unblocked (sanitizers, aarch64, Windows, macOS): build 75924. 🤖 Generated with Claude Code |
3ab4983 to
bb53ec3
Compare
Ray's bazel_skylib 1.6.1 declaration in ray_deps_setup() never took effect: py_repositories() runs first and its maybe() declares bazel_skylib 1.3.0. Declare 1.7.1 at the top of WORKSPACE so it wins, and drop the dead declaration. Also pin rules_pkg to 0.9.1 ahead of protobuf_deps(). 0.9.1 is the newest release that still has the root providers.bzl stub the v3.20.3 protobuf used for Python/Java codegen loads. Both are versions the protobuf 29 / gRPC 1.69 bump (#66483) needs; landing them first keeps that PR smaller. rules_cc stays in #66483: 0.0.14 drops cc_proto_library and 0.0.15+ loads protobuf's bazel/ package, so it can only move together with protobuf. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
rules_java 7.x compiles Java at source/target 8 by default; 8.x defaults to 11. On the protobuf 29 / rules_java 8 branch (#66483) Ray's jars came out as class file version 55, which a Java 8 runtime rejects (UnsupportedClassVersionError in test_raydp and test_logging_java). Pin --java_language_version=8 now; under rules_java 7.x this matches the default and changes nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
sai-miduthuri
left a comment
There was a problem hiding this comment.
Should this PR be stacked with 67717, 67718, 67719, 67720, 67721 ?
|
|
||
| os._exit(1) | ||
| import threading | ||
|
|
||
| # Exit shortly after this call returns, not inside it. The router only | ||
| # treats a request as delivered once the replica's "accepted" message | ||
| # arrives; os._exit() inside the call can kill the process before that | ||
| # message leaves it, so the router retries on the other replica, which | ||
| # then exits too and leaves no live replica. | ||
| threading.Timer(0.5, os._exit, args=(1,)).start() |
There was a problem hiding this comment.
Same comment as #67717 (comment)
Can this use asyncio.sleep + asyncio.create_task?
…lmod mode Not for merge. Proof of concept on top of #66483 and #66305, still on Bazel 7.5.0. - Turn on bzlmod alongside WORKSPACE (--enable_bzlmod --enable_workspace). - MODULE.bazel declares only rules_rust and rules_rust_pyo3 (0.74.0), so none of Ray's WORKSPACE repos change: com_google_protobuf stays 29.6 and the module graph's protobuf/rules_python live in separate canonical repos. - rust_probe/: a rust_library + rust_test, and a pyo3_extension consumed by a py_test as a data file. It cannot go in deps: the module world's rules_python PyInfo is a different provider than WORKSPACE's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
## Description Bumps two Bazel rule repos that the protobuf 29 / gRPC 1.69 bump (#66483) needs, so that PR is smaller. - **bazel_skylib 1.6.1 -> 1.7.1:** declared at the top of `WORKSPACE`. Ray's existing skylib 1.6.1 declaration in `ray_deps_setup()` never took effect: `py_repositories()` runs first, and its `maybe()` declares bazel_skylib 1.3.0. The first declaration of a repo wins, so it now has to come first. Protobuf 29 needs skylib >= 1.7.0 (`paths.is_normalized()`). - **rules_pkg 0.9.1:** pinned ahead of `protobuf_deps()`. It's the newest release that still has the root `providers.bzl` stub, which the v3.20.3 protobuf used for Python/Java codegen still loads. rules_cc stays in #66483. 0.0.14 drops `cc_proto_library`, and 0.0.15+ loads protobuf's `bazel/` package, which protobuf 23.4 doesn't have, so it can only move together with protobuf. ## Related issues Split out of #66483 (protobuf 29 / gRPC 1.69) to make that PR easier to review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
8444a22 to
cef9fdd
Compare
…lmod mode Not for merge. Proof of concept on top of #66483 and #66305, still on Bazel 7.5.0. - Turn on bzlmod alongside WORKSPACE (--enable_bzlmod --enable_workspace). - MODULE.bazel declares only rules_rust and rules_rust_pyo3 (0.74.0), so none of Ray's WORKSPACE repos change: com_google_protobuf stays 29.6 and the module graph's protobuf/rules_python live in separate canonical repos. - rust_probe/: a rust_library + rust_test, and a pyo3_extension consumed by a py_test as a data file. It cannot go in deps: the module world's rules_python PyInfo is a different provider than WORKSPACE's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
## Description gRPC >= 1.65 logs through absl. When `GRPC_VERBOSITY` is unset, gRPC leaves absl's minimum log level alone, and absl defaults to INFO. gRPC INFO messages (e.g. "Got goaway") then reach stderr and get forwarded to the driver. Older gRPC defaulted to ERROR. `RayLog::StartRayLog` now sets absl's minimum log level to ERROR once per process, unless `GRPC_VERBOSITY` is set. Ray's own logging goes through spdlog and is unaffected. Note for reviewers: protobuf (23.4 today) also logs through absl, so landing this before the gRPC bump also hides protobuf's absl INFO and WARNING output. Master ends up in that state after the bump anyway. ## Related issues Split out of #66483 (protobuf 29 / gRPC 1.69) to make that PR easier to review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
## Description `GrpcClient::IsChannelIdleAfterRPCs()` treated a client as idle whenever its channel reported `IDLE` after the first call. gRPC moves a channel out of `IDLE` asynchronously once a call starts, so a client could report idle while a call was still in flight. The core worker client pool then evicts that client, and the next actor task goes out on a new client with fresh sequence state. The result is out-of-order or cancelled actor tasks. This PR: - Counts calls whose callback hasn't run yet, and only reports idle when that count is zero. The counter is a `shared_ptr`, so a reply that arrives after the client is destroyed can still decrement it. It is decremented only after the user callback runs, so the client can't look idle while it's still handling a reply. - Adds `TestNotIdleWhileCallInFlight`. - Makes `ReconnectionBackoff` time its no-reconnect window from when the channel enters `TRANSIENT_FAILURE`, instead of after a fixed 1s wait. The 2s backoff has up to 20% jitter, so the old window could overlap the first retry. On gRPC 1.58 the race is rare. On 1.69 the channel stays `IDLE` noticeably longer after the first call, and actor-ordering tests failed often. ## Related issues Split out of #66483 (protobuf 29 / gRPC 1.69) to make that PR easier to review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…lmod mode Not for merge. Proof of concept on top of #66483 and #66305, still on Bazel 7.5.0. - Turn on bzlmod alongside WORKSPACE (--enable_bzlmod --enable_workspace). - MODULE.bazel declares only rules_rust and rules_rust_pyo3 (0.74.0), so none of Ray's WORKSPACE repos change: com_google_protobuf stays 29.6 and the module graph's protobuf/rules_python live in separate canonical repos. - rust_probe/: a rust_library + rust_test, and a pyo3_extension consumed by a py_test as a data file. It cannot go in deps: the module world's rules_python PyInfo is a different provider than WORKSPACE's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
## Description Fixes four tests that depend on timing. They pass today but failed consistently, on some platforms, once gRPC was bumped to 1.69 in #66483. Each change makes the test wait for the state it assumes, instead of hoping that state is already reached: - `test_release_resource`: the raylet can grant leases out of submission order, so the canary task could take the CPU before `f`. Wait until `f` is running before submitting the canary. (On Windows the canary won every time.) - `test_broadcast` (llm): `self_destruct` called `os._exit()` inside the call, which can kill the replica before its "accepted" message reaches the router. The router then retries on the other replica, which also exits. Exit shortly after the call returns instead. - `test_capacity_queue_router`: same pattern. Let the crashing replica's acceptance through before it exits. - `TestEvictLineageStopsAtTarget`: pass `max_retries` inline. The lambda used a local `const int` without capturing it, which GCC and Clang allow for a constant but MSVC rejects. All test-only. No runtime changes. ## Related issues Split out of #66483 (protobuf 29 / gRPC 1.69) to make that PR easier to review. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: elliot-barn <sim@local> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
rules_java 8.x (needed for Bazel 8) loads @com_google_protobuf//bazel:*.bzl, which does not exist in the v23.4-era protobuf Ray pinned, so the two move together. gRPC < 1.69 builds a standalone @upb that does not compile against protobuf 29, so gRPC (and abseil, boringssl to match it) moves too. - Declare bazel_skylib 1.7.1, rules_cc 0.0.16 and rules_java 8.14.0 at the top of WORKSPACE. The first declaration of a repo wins, and rules_python's py_repositories() otherwise pulls skylib 1.3.0 and rules_cc 0.0.13. - Run rules_java_dependencies() after ray_deps_setup(), so its maybe() does not replace Ray's protobuf with 29.0-rc2. - Pin rules_pkg 0.9.1: the v3.20.3 protobuf used by rules_proto_grpc loads the root @rules_pkg//:providers.bzl stub, which rules_pkg 0.10.0 removed. - Arena::CreateMessage -> Arena::Create, always_print_primitive_fields -> always_print_fields_with_no_presence (same output for Ray's protos). - Load cc_proto_library from protobuf; use gRPC's health_cc_grpc target. - Drop protobuf-bazel7.patch, grpc-disable-layering-check.patch and grpc's protobuf.patch; port the thread-count, NextResult and zlib-fdopen patches. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
- rules_java 8.14.0 -> 8.12.0: from 8.13.0 on, the prebuilt java_tools need GLIBCXX_3.4.21, newer than manylinux2014's libstdc++ (jar build). - Keep boringssl at 2ff4b968: later commits require C11 <stdalign.h> on MSVC, which the Windows CI SDK (10.0.19041) lacks (Windows build). - Restore grpc-disable-layering-check.patch, ported to 1.69: gRPC's own BUILD files miss deps that clang enforces on macOS (macOS build). - Define PROTOBUF_FUTURE_REMOVE_CREATEMESSAGE: GCC 10 warns on the deprecated shim's own body in every file including arena.h, and -Werror makes that fatal (all manylinux wheel / cpp / java images). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
rules_java 7.x compiled Java at source/target 8 by default; 8.x defaults to 11. Ray's jars came out as class file version 55, which a Java 8 runtime rejects (UnsupportedClassVersionError in test_raydp and test_logging_java). Pin --java_language_version=8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
…240722.2 - Keep gRPC's EventEngine client and listener off on Windows. gRPC 1.69 enables them there (1.58 marked them broken), and they abort at teardown: win_socket.cc "Check failed: is_shutdown_" (test_implicit_resource, test_object_spilling_2_asan). Posix keeps 1.69's defaults. - abseil 20240722.0 -> 20240722.2: patch 1 fixed a security issue in hash container create/resize. - UBSan: GCC rejects abseil's hash containers under the null, nonnull-attribute and returns-nonnull-attribute checks (a function-pointer comparison in a constexpr stops being a constant expression). Turn those three off; they must follow -fsanitize=undefined in the same flag list. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
The Windows patch moved gRPC's client and listener back to iomgr but left
event_engine_callback_cq on. On Windows grpc_iomgr_run_in_background()
returns IsEventEngineCallbackCqEnabled(), so gRPC assumed I/O makes progress
in the background and gave callback-API code no polling thread, while the
iomgr sockets need one. pubsub_integration_test, which only uses the
callback API, could never connect ('tcp handshaker shutdown' after 20s).
Raylet/GCS only worked because their CompletionQueue threads poll the same
iomgr. Turn the callback CQ off too so callback-API code uses
CallbackAlternativeCQ, which polls iomgr, as 1.58 did.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
GCC 11 reports a false -Wmaybe-uninitialized in protobuf 29's generated move-assignment (CanMoveWithInternalSwap) when it is inlined into core_worker.cc under the ubsan config, and -Werror turns it into a build failure for core_worker_lib. Keep the warning but don't make it fatal under ubsan. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Bazel's own Linux releases need glibc >= 2.25 since Bazel 8, so they cannot start in manylinux2014 (CentOS 7, glibc 2.17), where Ray builds its Linux wheels. Add a bazel-glibc217 wanda image that builds the .bazelversion release from source inside that image (bootstrap with compile.sh, then //src:bazel with an embedded JDK) and smoke-tests a server start there. The core, cpp-core and java image builds and the manylinux CI image copy it in and point bazelisk at it. Wheels keep targeting glibc 2.17. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
On x86_64 the second-stage //src:bazel build runs rules_java's prebuilt ijar, which needs GLIBCXX_3.4.21 and fails on CentOS 7. Ship compile.sh's bazel_nojdk with the Temurin JDK 21 it was built with, passed via --server_javabase. Embed the release label so 'bazel info release' (and anything keyed on the version) reports , not no_version, which is what failed the aarch64 smoke test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Each test built a fresh mock workspace and HOME, so every bazel query started a new Bazel server, and on Bazel 8 fetched rules_python from the registry to autoload the mock BUILD's py_test. Six of those took the small test past its 60s timeout (69s locally). Nothing writes to the workspace, so make the fixture module-scoped: 21.5s locally. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Move from Bazel 7.5.0 to 8.8.1, still in WORKSPACE mode (bzlmod stays off, so every repo still comes from WORKSPACE and there is one copy of protobuf, rules_java and rules_python). - .bazelversion 7.5.0 -> 8.8.1. - --noincompatible_disallow_empty_glob: the root BUILD.bazel globs platform-specific paths that are empty on other platforms. - --noincompatible_disallow_ctx_resolve_tools: the 2021 rules_proto_grpc pin still calls ctx.resolve_tools. - Pin rules_proto 7.1.0 ahead of grpc_deps(): 6.0.2 reads native proto_common.ProtoLangToolchainInfo, which Bazel 8 removed. Official Bazel 8 binaries need glibc >= 2.25 and can't start in the manylinux2014 images, so the previous commits build Bazel for glibc 2.17 in CI. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
Bazel 8 autoloads sh_binary/sh_test from rules_shell, and on Windows they
need a registered shell toolchain to build their launcher. Bzlmod registers
it automatically; in WORKSPACE mode nothing did, so every Windows job failed
analysis on @bazel_tools//tools/test:collect_coverage ("No suitable shell
toolchain found"). Declare rules_shell 0.2.0 (protobuf 29's pin) early and
call rules_shell_toolchains().
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
c867d2a to
59c6539
Compare
…lmod mode Not for merge. Proof of concept on top of #66483 and #66305, still on Bazel 7.5.0. - Turn on bzlmod alongside WORKSPACE (--enable_bzlmod --enable_workspace). - MODULE.bazel declares only rules_rust and rules_rust_pyo3 (0.74.0), so none of Ray's WORKSPACE repos change: com_google_protobuf stays 29.6 and the module graph's protobuf/rules_python live in separate canonical repos. - rust_probe/: a rust_library + rust_test, and a pyo3_extension consumed by a py_test as a data file. It cannot go in deps: the module world's rules_python PyInfo is a different provider than WORKSPACE's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
The *_pb2_grpc.py stubs come from the Python plugin of the gRPC that Ray builds. From 1.63 on, that plugin emits `_registered_method=True` on client stubs and `server.add_registered_method_handlers()`, which only exist in grpcio >= 1.64. With gRPC 1.69 the stubs failed on grpcio 1.62 (client and server) and 1.63 (server), while setup.py allows grpcio >= 1.42.0. CI pins grpcio 1.75, so it never showed. Patch the plugin to leave both out, so the stubs match what the 1.58 plugin generated. This gives up grpcio's registered-method fast path, which Ray's stubs did not use before either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
…lmod mode Not for merge. Proof of concept on top of #66483 and #66305, still on Bazel 7.5.0. - Turn on bzlmod alongside WORKSPACE (--enable_bzlmod --enable_workspace). - MODULE.bazel declares only rules_rust and rules_rust_pyo3 (0.74.0), so none of Ray's WORKSPACE repos change: com_google_protobuf stays 29.6 and the module graph's protobuf/rules_python live in separate canonical repos. - rust_probe/: a rust_library + rust_test, and a pyo3_extension consumed by a py_test as a data file. It cannot go in deps: the module world's rules_python PyInfo is a different provider than WORKSPACE's. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: elliot-barn <elliot.barnwell@anyscale.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 99c1471. Configure here.
| + out->Print("metadata)\n"); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
Plugin patch misses version gate
High Severity
The new plugin patch only strips _registered_method=True and add_registered_method_handlers(). gRPC 1.69's Python plugin still emits a GRPC_GENERATED_VERSION check that rejects grpcio below 1.69.0 at import, so *_pb2_grpc.py stubs fail on the grpcio >= 1.42.0 floor setup.py still allows. CI will not catch this because the lockfile pins grpcio 1.78.0.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 99c1471. Configure here.


Why
This PR moves Ray to Bazel 8.8.1, still in WORKSPACE mode, together with the dependency bumps that Bazel 8 forces. It is the Bazel 8 step of the Bazel 7.5 → 8 → 9 migration. The earlier steps (#66160, #66207, #66305) got the tree as far as letting Bazel 8 start.
Bazel 8 needs
rules_java8.x. Everyrules_java8.x release loads@com_google_protobuf//bazel:java_proto_library.bzl, and that file does not exist in the v23.4-era protobuf commit Ray pins. Sorules_javaand protobuf have to move together, and protobuf ≥ 29 then pulls gRPC and abseil along.Split for review
The parts that work on master on their own are split out into separate PRs. Please review those first. Once they merge, this PR is rebased and those commits drop out of the diff.
GRPC_VERBOSITYis set (see below)Arena::CreateMessage→Arena::Create, and pin Java 8 bytecode ahead ofrules_java8bazel_skylib1.7.1 andrules_pkg0.9.1What stays here: the Bazel version, the protobuf /
rules_java/ gRPC / abseil /rules_ccbumps, the code and patch changes they need, the glibc 2.17 Bazel build for CI, and the Windows / sanitizer / test fixes for gRPC 1.69.Versions
com_google_protobuf2c5fa078(~v23.4)rules_java8.x loads from itsbazel/packagerules_javajava_tools(singlejar,ijar,one_version) needGLIBCXX_3.4.21, newer than manylinux2014's libstdc++. 8.x also changed the default Java language level from 8 to 11, so.bazelrcpins--java_language_version=8(#67720).com_github_grpc_grpc@upbthat fails to compile against protobuf 29'sdescriptor.proto(FileDescriptorProto.editionis now an enum). 1.69.0 is the first gRPC whosegrpc_deps.bzlpins protobuf 29.com_google_abslrules_protogrpc_deps())proto_common.ProtoLangToolchainInfo, which Bazel 8 removedrules_ccbazel_skylibpaths.is_normalized()(#67721)rules_pkgboringssl2ff4b9682ff4b968(unchanged)b8b3e6e1. Every later boringssl requires C11<stdalign.h>on MSVC, which the Windows CI SDK (10.0.19041) doesn't ship.Bazel 8
.bazelversion7.5.0 → 8.8.1. Bzlmod stays off (--noenable_bzlmod --enable_workspace), so every external repo still comes from WORKSPACE and there is exactly one copy of protobuf,rules_javaandrules_python.--noincompatible_disallow_empty_glob: the rootBUILD.bazelglobs platform-specific paths that are empty on other platforms.--noincompatible_disallow_ctx_resolve_tools: the 2021rules_proto_grpcpin still callsctx.resolve_tools.ci/docker/bazel-glibc217, buildsbazel_nojdkfrom the release's dist zip insiderayproject/manylinux2014(devtoolset-10) and ships it with Temurin JDK 21. The ray-core, ray-cpp-core, ray-java and manylinux images put it behindbazelisk. Rebuilding Bazel only happens when.bazelversionchanges. Wheels still target manylinux2014, so the user glibc floor is unchanged.ci/ray_ci/test_bazel_sharding.pyshares one mock workspace across its tests. Each test used to start a new Bazel server, which on Bazel 8 also re-fetchesrules_pythonfor autoloads and pushed it past its 60s timeout.Declaration order: the first declaration of a repo wins
Several bumps only take effect because of where they are declared. In WORKSPACE, a repo keeps its first declaration: a
maybe()skips a repo that already exists, and a later plainhttp_archiveis ignored.bazel_skylib/rules_ccare declared at the top ofWORKSPACE.py_repositories()(rules_python 0.40.0) declares skylib 1.3.0 and rules_cc 0.0.13 beforeray_deps_setup()runs, so the skylib pin inray_deps_setup.bzlhas had no effect since [build] Move rules_python off 0.9.0 #66207.rules_java_dependencies()runs afterray_deps_setup(). It declares its owncom_google_protobuf(29.0-rc2) throughmaybe(). If it ran first, it would silently replace Ray's pin.rules_pkgis pinned to 0.9.1 beforeprotobuf_deps()runs, which would otherwise declare 1.0.1. The v3.20.3 protobuf thatrules_proto_grpcuses loads the root@rules_pkg//:providers.bzlstub, which was deleted in 0.10.0.rules_proto7.1.0 is declared beforegrpc_deps()for the same reason.The versions that actually resolved were verified by reading each fetched repo's
MODULE.bazel/version.json.bazel querydoes not catch these swaps.Code changes needed by the new versions
.bazelrcdefinesPROTOBUF_FUTURE_REMOVE_CREATEMESSAGE, which compiles out protobuf's deprecatedArena::CreateMessageshim. GCC 10 (the manylinux2014 devtoolset) warns on the shim's own body in every file that includesarena.h, and-Werrormakes that fatal.JsonPrintOptions::always_print_primitive_fields→always_print_fields_with_no_presence(event.cc, one test). The export-event JSON does not change: unset proto3optionalfields were omitted before and still are.cc_proto_libraryloads from@com_google_protobuf//bazel:cc_proto_library.bzlrather than@rules_cc(3 BUILD files).health_cc_grpcin 1.69 (2 BUILD files).null,nonnull-attributeandreturns-nonnull-attributechecks, so those three are off. GCC 11 also reports a false-Wmaybe-uninitializedin protobuf 29's generated move-assignment under ubsan; it is no longer fatal there.gRPC 1.69 behaviour changes
Actor task ordering (real runtime bug, #67718). gRPC 1.69 leaves a channel
IDLEfor a moment after its first call starts.CoreWorkerClientPoolevicts idle clients, so the client that sent an actor's first task could be evicted before the second task, which then went out on a new client with fresh sequence state. The actor ran the second task first and cancelled the first as stale (Task canceled due to stale sequence number). Fix:GrpcClientcounts calls in flight and is only idle when none are. Local repro: 11/20 out of order before, 0/30 after.gRPC INFO logs reach the driver (#67719). gRPC ≥ 1.65 logs through absl and leaves absl's INFO default alone when
GRPC_VERBOSITYis unset, so lines such aschttp2_transport.cc ... Got goawaywere forwarded to drivers as(raylet) .... Ray now sets absl's minimum level to ERROR unlessGRPC_VERBOSITYis set.Windows EventEngine. gRPC 1.69 turns on the EventEngine client and listener on Windows (1.58 marked them broken), and they abort at teardown (
win_socket.cc"Check failed: is_shutdown_"). They stay off on Windows, and so does the EventEngine callback CQ: without it, callback-API code got no polling thread andpubsub_integration_testcould never connect. Posix keeps 1.69's defaults.Test timing. gRPC 1.69 makes some existing races easy to hit.
test_broadcast(LLM) and the Serve replica-death test now let the dying replica's "accepted" message go out before it exits. The rest are in #67717.Patches
protobuf-bazel7.patchexec_toolsleft.third_party/protobuf.patchgrpc-disable-layering-check.patchgsm→csm; fuzzers package gone). Without it macOS fails on gRPC's own missing deps.grpc-configurable-thread-count.patchcpu.ccmoved tosrc/core/util/linux/. Behaviour unchanged.grpc-nextresult-cancelled-init.patchgrpc-python-plugin-no-registered-method.patch_registered_method=Trueandserver.add_registered_method_handlers(), which need grpcio >= 1.64. The patch leaves both out, so the*_pb2_grpc.pystubs match what the 1.58 plugin generated and keep working with thegrpcio >= 1.42.0thatsetup.pyallows. Checked on grpcio 1.42.0, 1.62.3, 1.64.3 and 1.75.0; without the patch the stubs fail on 1.62 and 1.63.grpc-zlib-fdopen.patchhttp_archive.grpc-cython-copts.patch,abseil-cpp-shadow.patchWhat stays the same
com_google_protobuf_rules_proto_grpc(v3.20.3).grpcio >= 1.42.0. Seegrpc-python-plugin-no-registered-method.patchabove; CI pins grpcio 1.75, so only a test with an old grpcio shows this.Please review closely
bazel build //...on Bazel 8 reports conflicting actions for//cpp:plus.so///cpp:counter.so(built in two test configurations). The targets CI builds are not affected.//release:requirements_*already fails to analyze on master's Bazel 7.5.Tests run
bazel build --nobuild //:ray_pkg_zip //:ray_py_proto_zip //java:gen_ray_java_pkg //cpp:ray_cpp_pkg_zipbazel build //:ray_py_proto_zip //src/ray/gcs_rpc_client/tests:gcs_client_testbazel build --nobuild -k //...The Bazel 8 parts were first run in full CI on the PyO3 POC (#66875): all 14 native images built on Bazel 8 inside CentOS 7, and the remaining failures were the gRPC ones fixed here.
AI assistance was used for the analysis and for drafting this change.
🤖 Generated with Claude Code