Skip to content

Conversation

@shunping
Copy link
Collaborator

@shunping shunping commented Dec 5, 2025

GRPC error as in https://github.com/apache/beam/actions/runs/19958369481/job/57232567333. Notice Python Precommit ML is running on FnAPI runner not prism, as Go environment is not set up in the workflow:

- name: Setup environment
uses: ./.github/actions/setup-environment-action
with:
java-version: default
python-version: ${{ matrix.python_version }}

The error message:

WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
I0000 00:00:1764927812.016144   20174 chttp2_transport.cc:1341] ipv4:127.0.0.1:54619: Got goaway [11] err=UNAVAILABLE:GOAWAY received; Error code: 11; Debug Text: too_many_pings {grpc_status:14, http2_error:11}
E0000 00:00:1764927812.016312   20174 chttp2_transport.cc:1370] ipv4:127.0.0.1:54619: Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug data equal to "too_many_pings". Current keepalive time (before throttling): 20000ms
ERROR:apache_beam.runners.worker.data_plane:Failed to read inputs in the data plane.
Traceback (most recent call last):
  File "/runner/_work/beam/beam/sdks/python/test-suites/tox/py313/build/srcs/sdks/python/target/.tox-py313-ml/py313-ml/lib/python3.13/site-packages/apache_beam/runners/worker/data_plane.py", line 707, in _read_inputs
    for elements in elements_iterator:
                    ^^^^^^^^^^^^^^^^^
  File "/runner/_work/beam/beam/sdks/python/test-suites/tox/py313/build/srcs/sdks/python/target/.tox-py313-ml/py313-ml/lib/python3.13/site-packages/grpc/_channel.py", line 538, in __next__
    return self._next()
           ~~~~~~~~~~^^
  File "/runner/_work/beam/beam/sdks/python/test-suites/tox/py313/build/srcs/sdks/python/target/.tox-py313-ml/py313-ml/lib/python3.13/site-packages/grpc/_channel.py", line 962, in _next
    raise self
grpc._channel._MultiThreadedRendezvous: <_MultiThreadedRendezvous of RPC that terminated with:
	status = StatusCode.UNAVAILABLE
	details = "Socket closed"
	debug_error_string = "UNKNOWN:Error received from peer ipv4:127.0.0.1:54619 {grpc_message:"Socket closed", grpc_status:14}"
>
I0000 00:00:1764927973.139396    3231 chttp2_transport.cc:1341] ipv4:127.0.0.1:54619: Got goaway [11] err=UNAVAILABLE:GOAWAY received; Error code: 11; Debug Text: too_many_pings {http2_error:11, grpc_status:14}
E0000 00:00:1764927973.139482    3231 chttp2_transport.cc:1370] ipv4:127.0.0.1:54619: Received a GOAWAY with error code ENHANCE_YOUR_CALM and debug data equal to "too_many_pings". Current keepalive time (before throttling): 40000ms

I also notice that the change on sdks/python/apache_beam/utils/subprocess_server.py in #36528 may not be effective. Even though the file and class name has "server", it is actually a grpc client which connects to the grpc server endpoint (https://github.com/liferoad/beam/blob/782a0e7cc26e582c31534253fa5a00018bce4c38/sdks/python/apache_beam/utils/subprocess_server.py#L202).

If this fix works (getting rid of too-many-pings errors in precommits), we may also tune the setting on PrismRunner.

Some references:

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shunping, 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 a critical issue causing gRPC connections in the FnAPI runner to fail due to excessive pings. By explicitly configuring the minimum ping interval on the server to align with the client's keepalive settings, the change significantly enhances the stability and longevity of gRPC communication, thereby improving the overall reliability of the Beam FnAPI runner.

Highlights

  • gRPC Configuration: Introduced a new gRPC option, grpc.http2.min_ping_interval_without_data_ms, setting its value to 20,000 milliseconds within the FnAPI runner's worker handlers.
  • Connection Stability: This modification aims to resolve 'too-many-pings' errors by synchronizing the server-side gRPC keepalive settings with the client's grpc.keepalive_time_ms.
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 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 counter productive. 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

@shunping shunping marked this pull request as ready for review December 5, 2025 19:35
@shunping
Copy link
Collaborator Author

shunping commented Dec 5, 2025

Looks like a good start. Let's give it a try

@shunping shunping merged commit e5a9338 into apache:master Dec 5, 2025
101 of 102 checks passed
shunping added a commit to shunping/beam that referenced this pull request Dec 11, 2025
* Fix too-many-pings on FnAPI runner under grpc mode

* Fix lints
shunping added a commit that referenced this pull request Dec 11, 2025
* Fix too-many-pings on FnAPI runner under grpc mode (#37013)

* Fix too-many-pings on FnAPI runner under grpc mode

* Fix lints

* Set keepalive policy for prism grpc server. (#37021)
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