Skip to content

[Draft] Python repro example for ping timeout issue#39359

Draft
sreenithi wants to merge 1 commit intogrpc:masterfrom
sreenithi:ping_timeout_py_repro
Draft

[Draft] Python repro example for ping timeout issue#39359
sreenithi wants to merge 1 commit intogrpc:masterfrom
sreenithi:ping_timeout_py_repro

Conversation

@sreenithi
Copy link
Copy Markdown
Contributor

@sreenithi sreenithi commented Apr 24, 2025

This PR includes the Python server and client code to reproduce the ping timeout issue that was recently reported by Dataflow as well as in issue #38282. This PR is only meant for reference and doesn't require to be merged to the repo.

Steps to reproduce the ping timeout via Bazel in Python:

  • export GRPC_TRACE=tcp,http,http2_keepalive,http2_ping,polling,polling_api
  • export GRPC_VERBOSITY=debug
  • Run bazel run //examples/python/ping_timeout_repro:greeter_server_py --copt=-DGRPC_DO_NOT_INSTANTIATE_POSIX_POLLER to start the Python server
  • Run bazel run //examples/python/ping_timeout_repro:repro_greeter_client_py --copt=-DGRPC_DO_NOT_INSTANTIATE_POSIX_POLLER to start the Python client

Steps to reproduce the ping timeout directly using Python without Bazel:

  • Use a grpcio version >=1.68.0
  • export GRPC_TRACE=tcp,http,http2_keepalive,http2_ping,polling,polling_api
  • export GRPC_VERBOSITY=debug
  • Run python examples/python/ping_timeout_repro/greeter_server.py to start the Python server
  • Run examples/python/ping_timeout_repro/repro_greeter_client.py to start the Python client

NOTE: The issue can only be reproduced via Bazel when including the --copt flag via command line, however if running directly via Python it doesn't require the command-line flag. Running the example as described above with the specific debug trace logs should show log lines such as:

I0000 00:00:1745420380.475681 3473830 chttp2_transport.cc:1963] ipv6:%5B::1%5D:50051: Ping timeout. Closing transport.
...
I0000 00:00:1745420380.476151 3473830 chttp2_transport.cc:1844] 0x7ffb90001600 CANCEL PINGS: UNKNOWN:ping timeout {grpc_status:14}
...
I0000 00:00:1745420380.477078 3473830 chttp2_transport.cc:1844] 0x7ffb90001600 CANCEL PINGS: UNKNOWN:goaway sent
...
I0000 00:00:1745420380.477298 3473830 ev_posix.cc:186] (polling-api) fd_shutdown(5)
...
I0000 00:00:1745420380.477517 3473830 tcp_posix.cc:1105] TCP:0x55a33ded8300 got_read: UNKNOWN:FD Shutdown {children:[UNAVAILABLE:endpoint shutdown]}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lang/Python release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant