From e7286a205c7cb45a6af795192977a075a26bcf4e Mon Sep 17 00:00:00 2001 From: The tunix Authors Date: Thu, 20 Aug 2026 11:46:09 -0700 Subject: [PATCH] Allow client keep alive pings in worker gRPC servers PiperOrigin-RevId: 967957867 --- tests/experimental/worker/remote_execution_test.py | 7 +++++++ tunix/experimental/worker/remote_execution.py | 2 ++ 2 files changed, 9 insertions(+) diff --git a/tests/experimental/worker/remote_execution_test.py b/tests/experimental/worker/remote_execution_test.py index f4369a9ea..4079f3273 100644 --- a/tests/experimental/worker/remote_execution_test.py +++ b/tests/experimental/worker/remote_execution_test.py @@ -906,6 +906,13 @@ def test_grpc_sync_submit_survives_repeated_calls(self): finally: asyncio.run(handle.close()) # tears down the persistent submit loop + def test_grpc_options_tolerate_client_keepalive_pings(self): + options = dict(remote_lib._grpc_options()) + self.assertEqual( + options["grpc.http2.min_recv_ping_interval_without_data_ms"], 10000 + ) + self.assertEqual(options["grpc.http2.max_ping_strikes"], 0) + def test_grpc_sync_start_serving_actually_serves(self): port = portpicker.pick_unused_port() server = remote_lib.GrpcRemoteExecutionServer( diff --git a/tunix/experimental/worker/remote_execution.py b/tunix/experimental/worker/remote_execution.py index 8460473c2..51d382f71 100644 --- a/tunix/experimental/worker/remote_execution.py +++ b/tunix/experimental/worker/remote_execution.py @@ -88,6 +88,8 @@ def _grpc_options() -> List[Tuple[str, int]]: ("grpc.keepalive_time_ms", 20000), ("grpc.keepalive_timeout_ms", 10000), ("grpc.keepalive_permit_without_calls", 1), + ("grpc.http2.min_recv_ping_interval_without_data_ms", 10000), + ("grpc.http2.max_ping_strikes", 0), ]