Skip to content

[Backport][v1.71.x][Python Core][EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled#39948

Merged
sergiitk merged 1 commit intogrpc:v1.71.xfrom
sreenithi:backport-1.71-python-fix-reconnect
Jun 26, 2025
Merged

[Backport][v1.71.x][Python Core][EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled#39948
sergiitk merged 1 commit intogrpc:v1.71.xfrom
sreenithi:backport-1.71-python-fix-reconnect

Conversation

@sreenithi
Copy link
Copy Markdown
Contributor

Backport of #39894 to v1.71.x.

Fix the issue with gRPC Python Client not recovering in certain situations: #38290, #39113, #39631.


This PR:

  • Keeps iomgr backup poller enabled on platforms that do not support that have EventEngine / POSIX poller disabled.
  • Fixes and hardens Python's reconnect_test.

This fixes issues with Python Client recovery in certain cases when it falls back to the backup poller. Note that currently Python disables POSIX poller manually via GRPC_PLATFORM_SUPPORTS_POSIX_POLLING due to currently unresolved fork issue.

Unlike #39131, this change is meant to be tested and merged to master, and then backported to past branches with broken python client reconnect logic.

However, once Event Engine fork support is fixed, Python will switch to it by removing GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER from all builds. After that, the backup poller should not be needed for Python. With the updated test, the case with python relying on the backup poller is covered, and we should be able to detect issues with Python having to rely on in after switching to EE.

…en EE is disabled (grpc#39894)

Fix the issue with gRPC Python Client not recovering in certain situations: grpc#38290, grpc#39113, grpc#39631.

---

This PR:
- Keeps iomgr backup poller enabled on platforms that do not support that have EventEngine / POSIX poller disabled.
- Fixes and hardens Python's reconnect_test.

This fixes issues with Python Client recovery in certain cases when it falls back to the backup poller. Note that currently Python disables POSIX poller manually via `GRPC_PLATFORM_SUPPORTS_POSIX_POLLING` due to currently unresolved fork issue.

Unlike grpc#39131, this change is meant to be tested and merged to master, and then backported to past branches with broken python client reconnect logic.

However, once Event Engine fork support is fixed, Python will switch to it by removing `GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER` from all builds. After that, the backup poller should not be needed for Python. With the updated test, the case with python relying on the backup poller is covered, and we should be able to detect issues with Python having to rely on in after switching to EE.

Closes grpc#39894

COPYBARA_INTEGRATE_REVIEW=grpc#39894 from sergiitk:python-fix-reconnect 239b330
PiperOrigin-RevId: 773549056
@sreenithi sreenithi requested a review from sergiitk June 23, 2025 03:50
@sreenithi sreenithi requested a review from markdroth as a code owner June 23, 2025 03:50
@sreenithi sreenithi added lang/Python lang/core release notes: yes Indicates if PR needs to be in release notes labels Jun 23, 2025
@sergiitk sergiitk changed the title [Backport][v1.71.x][Python Core][EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled (v1.71.x backport) [Backport][v1.71.x][Python Core][EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled Jun 26, 2025
@sergiitk
Copy link
Copy Markdown
Member

Confirmed the errors are unrelated, and it's the same set as in #39716 (last PR), #39349 (tag - but the run is incomplete).

@sergiitk sergiitk merged commit 64de18b into grpc:v1.71.x Jun 26, 2025
57 of 61 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