Skip to content

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

Merged
yashykt merged 1 commit intogrpc:v1.73.xfrom
sreenithi:backport-1.73-python-fix-reconnect
Jun 23, 2025
Merged

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

Conversation

@sreenithi
Copy link
Copy Markdown
Contributor

Backport of #39894 to v1.73.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
@yashykt yashykt merged commit e6b3f29 into grpc:v1.73.x Jun 23, 2025
60 checks passed
@sergiitk sergiitk changed the title [Backport][v1.73.x][Python Core][EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled (v1.73.x backport) [Backport][v1.73.x][Python Core][EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled Jun 24, 2025
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.

3 participants