From 0c147cd78f6345cbff877c74495f4956b3ec03e6 Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut Date: Fri, 6 Nov 2026 23:48:31 +0530 Subject: [PATCH 1/6] using exp branch --- sdks/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/setup.py b/sdks/python/setup.py index 804514ebcc94..bf93514efbf4 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -441,7 +441,7 @@ def get_portability_package_data(): 'cryptography>=50.0.0', 'fastavro>=0.23.6,<2', 'fasteners>=0.3,<1.0', - 'grpcio>=1.33.1,<2,!=1.48.0,!=1.59.*,!=1.60.*,!=1.61.*,!=1.62.0,!=1.62.1,!=1.66.*,!=1.67.*,!=1.68.*,!=1.69.*,!=1.70.*', # pylint: disable=line-too-long + 'grpcio @ git+https://github.com/asheshvidyut/grpc.git@fix-pre-fork', # pylint: disable=line-too-long 'httplib2>=0.8,<1.0.0', 'jsonpickle>=3.0.4,<5.0.0', # numpy can have breaking changes in minor versions. From bdc75de24e27fc0305807e4896127df408e61d17 Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut Date: Fri, 6 Nov 2026 23:49:52 +0530 Subject: [PATCH 2/6] enable fork support --- sdks/python/tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini index 88acf2f7aaa3..f9aeccb484fd 100644 --- a/sdks/python/tox.ini +++ b/sdks/python/tox.ini @@ -48,7 +48,7 @@ setenv = RUN_SKIPPED_PY3_TESTS=0 # Set before importing gRPC; test-class setup is too late. # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. - GRPC_ENABLE_FORK_SUPPORT=0 + GRPC_ENABLE_FORK_SUPPORT=1 # Use an isolated tmp dir for tests that get slowed down by scanning /tmp. TMPDIR={envtmpdir} # Silence warning about ignoring PYTHONPATH. From 352a2ad3f238aa08eedd3b68f61fb81d0044d1e1 Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut Date: Fri, 6 Nov 2026 23:57:53 +0530 Subject: [PATCH 3/6] enable fork support --- .github/workflows/beam_PostCommit_Python_Versions.yml | 2 +- .github/workflows/beam_PreCommit_GoPortable.yml | 2 +- .github/workflows/beam_PreCommit_Python.yml | 2 +- .../apache_beam/runners/portability/portable_runner_test.py | 2 +- sdks/python/apache_beam/utils/subprocess_server_test.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/beam_PostCommit_Python_Versions.yml b/.github/workflows/beam_PostCommit_Python_Versions.yml index 621bdc5d55ce..4db3c626c0f8 100644 --- a/.github/workflows/beam_PostCommit_Python_Versions.yml +++ b/.github/workflows/beam_PostCommit_Python_Versions.yml @@ -54,7 +54,7 @@ env: OMP_NUM_THREADS: "1" OPENBLAS_NUM_THREADS: "1" # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. - GRPC_ENABLE_FORK_SUPPORT: "0" + GRPC_ENABLE_FORK_SUPPORT: "1" # gRPC stability - more conservative for unstable networks GRPC_ARG_KEEPALIVE_TIME_MS: "10000" GRPC_ARG_KEEPALIVE_TIMEOUT_MS: "15000" diff --git a/.github/workflows/beam_PreCommit_GoPortable.yml b/.github/workflows/beam_PreCommit_GoPortable.yml index 6391ec241f61..ccd1cae04329 100644 --- a/.github/workflows/beam_PreCommit_GoPortable.yml +++ b/.github/workflows/beam_PreCommit_GoPortable.yml @@ -35,7 +35,7 @@ concurrency: env: DEVELOCITY_ACCESS_KEY: ${{ secrets.BEAM_DEVELOCITY_ACCESS_KEY }} # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. - GRPC_ENABLE_FORK_SUPPORT: '0' + GRPC_ENABLE_FORK_SUPPORT: '1' # Setting explicit permissions for the action permissions: diff --git a/.github/workflows/beam_PreCommit_Python.yml b/.github/workflows/beam_PreCommit_Python.yml index 220ad5262781..73501fbb4a50 100644 --- a/.github/workflows/beam_PreCommit_Python.yml +++ b/.github/workflows/beam_PreCommit_Python.yml @@ -54,7 +54,7 @@ env: OMP_NUM_THREADS: "1" OPENBLAS_NUM_THREADS: "1" # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. - GRPC_ENABLE_FORK_SUPPORT: "0" + GRPC_ENABLE_FORK_SUPPORT: "1" # gRPC stability - more conservative for unstable networks GRPC_ARG_KEEPALIVE_TIME_MS: "10000" GRPC_ARG_KEEPALIVE_TIMEOUT_MS: "15000" diff --git a/sdks/python/apache_beam/runners/portability/portable_runner_test.py b/sdks/python/apache_beam/runners/portability/portable_runner_test.py index e781e13ce663..6b39a9c052fc 100644 --- a/sdks/python/apache_beam/runners/portability/portable_runner_test.py +++ b/sdks/python/apache_beam/runners/portability/portable_runner_test.py @@ -299,7 +299,7 @@ class PortableRunnerTestWithSubprocesses(PortableRunnerTest): @classmethod def setUpClass(cls): cls._old_fork_support = os.environ.get('GRPC_ENABLE_FORK_SUPPORT') - os.environ['GRPC_ENABLE_FORK_SUPPORT'] = 'false' + os.environ['GRPC_ENABLE_FORK_SUPPORT'] = 'true' super().setUpClass() # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. diff --git a/sdks/python/apache_beam/utils/subprocess_server_test.py b/sdks/python/apache_beam/utils/subprocess_server_test.py index 6f623e336070..bd8906acb423 100644 --- a/sdks/python/apache_beam/utils/subprocess_server_test.py +++ b/sdks/python/apache_beam/utils/subprocess_server_test.py @@ -42,7 +42,7 @@ class JavaJarServerTest(unittest.TestCase): @classmethod def setUpClass(cls): cls._old_fork_support = os.environ.get('GRPC_ENABLE_FORK_SUPPORT') - os.environ['GRPC_ENABLE_FORK_SUPPORT'] = 'false' + os.environ['GRPC_ENABLE_FORK_SUPPORT'] = 'true' super().setUpClass() # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. From 6b33dffb682813f4b0e1bc13fc6d8fa7739952d5 Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut Date: Fri, 6 Nov 2026 23:59:34 +0530 Subject: [PATCH 4/6] fixes --- sdks/python/tox.ini | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdks/python/tox.ini b/sdks/python/tox.ini index f9aeccb484fd..96188ea1ec3b 100644 --- a/sdks/python/tox.ini +++ b/sdks/python/tox.ini @@ -49,6 +49,8 @@ setenv = # Set before importing gRPC; test-class setup is too late. # TODO(https://github.com/grpc/grpc/issues/37710): Remove once fixed. GRPC_ENABLE_FORK_SUPPORT=1 + # Make Cython mandatory when pip builds grpcio from source (see setup.py). + GRPC_PYTHON_BUILD_WITH_CYTHON=1 # Use an isolated tmp dir for tests that get slowed down by scanning /tmp. TMPDIR={envtmpdir} # Silence warning about ignoring PYTHONPATH. From bd45699a73a73a9aacab273f2eb6a1a31fc2842b Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut Date: Fri, 6 Nov 2026 19:10:15 +0000 Subject: [PATCH 5/6] using github repo --- sdks/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/setup.py b/sdks/python/setup.py index bf93514efbf4..f697650116bb 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -441,7 +441,7 @@ def get_portability_package_data(): 'cryptography>=50.0.0', 'fastavro>=0.23.6,<2', 'fasteners>=0.3,<1.0', - 'grpcio @ git+https://github.com/asheshvidyut/grpc.git@fix-pre-fork', # pylint: disable=line-too-long + 'grpcio @ https://raw.githubusercontent.com/asheshvidyut/testing/blob/main/grpcio-1.86.0.dev0-cp311-cp311-linux_x86_64.whl', # pylint: disable=line-too-long 'httplib2>=0.8,<1.0.0', 'jsonpickle>=3.0.4,<5.0.0', # numpy can have breaking changes in minor versions. From bb9fba7481be4d705bfbd1069dfd09ff811b80b7 Mon Sep 17 00:00:00 2001 From: Ashesh Vidyut Date: Fri, 6 Nov 2026 19:13:47 +0000 Subject: [PATCH 6/6] using github repo --- sdks/python/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdks/python/setup.py b/sdks/python/setup.py index f697650116bb..91a12256caa7 100644 --- a/sdks/python/setup.py +++ b/sdks/python/setup.py @@ -441,7 +441,7 @@ def get_portability_package_data(): 'cryptography>=50.0.0', 'fastavro>=0.23.6,<2', 'fasteners>=0.3,<1.0', - 'grpcio @ https://raw.githubusercontent.com/asheshvidyut/testing/blob/main/grpcio-1.86.0.dev0-cp311-cp311-linux_x86_64.whl', # pylint: disable=line-too-long + 'grpcio @ https://raw.githubusercontent.com/asheshvidyut/testing/main/grpcio-1.86.0.dev0-cp311-cp311-linux_x86_64.whl', # pylint: disable=line-too-long 'httplib2>=0.8,<1.0.0', 'jsonpickle>=3.0.4,<5.0.0', # numpy can have breaking changes in minor versions.