Skip to content

Disable grpc fork support on some test suites.#38566

Merged
shunping merged 3 commits into
apache:masterfrom
shunping:disable-grpc-fork-support
May 20, 2026
Merged

Disable grpc fork support on some test suites.#38566
shunping merged 3 commits into
apache:masterfrom
shunping:disable-grpc-fork-support

Conversation

@shunping
Copy link
Copy Markdown
Collaborator

@shunping shunping commented May 20, 2026

We are still seeing DEADLINE EXCEEDED errors related to GRPC fork in our github test workflows:

  • JavaJarServerTest
  • PortableRunnerTestWithSubprocessesAndMultiWorkers

The issue has been tracked under grpc/grpc#37710.

Example traceback:

_____________________ JavaJarServerTest.test_classpath_jar _____________________
[gw3] darwin -- Python 3.13.13 /Users/runner/work/beam/beam/sdks/python/target/.tox/py313-macos/bin/python

self = <apache_beam.utils.subprocess_server_test.JavaJarServerTest testMethod=test_classpath_jar>

      @unittest.skipUnless(shutil.which('javac'), 'missing java jdk')
      def test_classpath_jar(self):
...
>           subprocess.check_call(f'java -jar {composite_jar}'.split())

apache_beam/utils/subprocess_server_test.py:225: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

popenargs = (['java', '-jar', 'beam_temp/composite-jars/b673a40efb1e743323f7a75a292271fa99a90ab0199fe71896bb17eacc17a88d.jar'],)
kwargs = {}, retcode = -6
cmd = ['java', '-jar', 'beam_temp/composite-jars/b673a40efb1e743323f7a75a292271fa99a90ab0199fe71896bb17eacc17a88d.jar']

    def check_call(*popenargs, **kwargs):
        """Run command with arguments.  Wait for command to complete.  If
        the exit code was zero then return, otherwise raise
        CalledProcessError.  The CalledProcessError object will have the
        return code in the returncode attribute.
    
        The arguments are the same as for the call function.  Example:
    
        check_call(["ls", "-l"])
        """
        retcode = call(*popenargs, **kwargs)
        if retcode:
            cmd = kwargs.get("args")
            if cmd is None:
                cmd = popenargs[0]
>           raise CalledProcessError(retcode, cmd)
E           subprocess.CalledProcessError: Command '['java', '-jar', 'beam_temp/composite-jars/b673a40efb1e743323f7a75a292271fa99a90ab0199fe71896bb17eacc17a88d.jar']' died with <Signals.SIGABRT: 6>.

/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py:419: CalledProcessError
----------------------------- Captured stderr call -----------------------------
I0520 04:04:48.181718   13998 fork_posix.cc:71] Other threads are currently calling into gRPC, skipping fork() handlers
I0520 04:04:48.189891  187465 ev_poll_posix.cc:593] FD from fork parent still in poll list: fd(23, generation: 1)
I0520 04:04:48.190076  187465 ev_poll_posix.cc:593] FD from fork parent still in poll list: fd(22, generation: 1)
I0520 04:04:48.190090  187465 ev_poll_posix.cc:593] FD from fork parent still in poll list: fd(35, generation: 1)

@shunping shunping marked this pull request as ready for review May 20, 2026 13:50
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses stability issues in the CI pipeline by disabling GRPC fork support for specific test suites that were failing with SIGABRT errors. By explicitly setting the GRPC_ENABLE_FORK_SUPPORT environment variable to 'false' during these tests, we prevent gRPC from attempting fork operations that conflict with the current test environment, while ensuring the original environment state is restored after test completion.

Highlights

  • GRPC Fork Support: Disabled GRPC fork support in specific test suites to resolve intermittent DEADLINE EXCEEDED errors.
  • Test Stability: Implemented setUpClass and tearDownClass methods to toggle the GRPC_ENABLE_FORK_SUPPORT environment variable for JavaJarServerTest and PortableRunnerTestWithSubprocessesAndMultiWorkers.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 disables gRPC fork support in the PortableRunnerTestWithSubprocessesAndMultiWorkers and JavaJarServerTest classes by setting the GRPC_ENABLE_FORK_SUPPORT environment variable to 'false'. The reviewer identified a missing os import in subprocess_server_test.py that would lead to a NameError. Additionally, the feedback suggests using addClassCleanup for more robust environment variable restoration, which ensures cleanup occurs even if the setup phase fails.

Comment thread sdks/python/apache_beam/utils/subprocess_server_test.py
Comment thread sdks/python/apache_beam/runners/portability/portable_runner_test.py
Comment thread sdks/python/apache_beam/utils/subprocess_server_test.py
@shunping
Copy link
Copy Markdown
Collaborator Author

r: @derrickaw

@github-actions
Copy link
Copy Markdown
Contributor

Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment assign set of reviewers

@shunping shunping merged commit 2105eaa into apache:master May 20, 2026
101 of 105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants