Skip to content

[EE] Reinstate the backup poller for Python#39131

Closed
drfloob wants to merge 3 commits intogrpc:masterfrom
drfloob:python-backup-poller
Closed

[EE] Reinstate the backup poller for Python#39131
drfloob wants to merge 3 commits intogrpc:masterfrom
drfloob:python-backup-poller

Conversation

@drfloob
Copy link
Copy Markdown
Member

@drfloob drfloob commented Apr 1, 2025

No description provided.

@drfloob drfloob added the release notes: no Indicates if PR should not be in release notes label Apr 1, 2025
@drfloob drfloob requested a review from yashykt April 1, 2025 19:03
@drfloob drfloob requested a review from markdroth as a code owner April 1, 2025 19:03
void grpc_client_channel_global_init_backup_polling() {
// Disable backup polling if EventEngine is used everywhere.
#ifdef GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER
g_backup_polling_disabled = false;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note that we also have the experiment event_engine_callback_cq which was added in 1.69. If that is enabled, grpc_iomgr_run_in_background will return true, and the backup poller will not be started. Why not add this logic in grpc_client_channel_start_backup_polling/grpc_client_channel_stop_backup_polling instead?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. If GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER is defined, the all of the logic to disable the backup poller is removed at compile time.

@tvalentyn
Copy link
Copy Markdown

IIUC this a workaround for #39113 .

@drfloob drfloob closed this May 28, 2025
copybara-service bot pushed a commit that referenced this pull request Jun 20, 2025
…en EE is disabled (#39894)

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.

Closes #39894

COPYBARA_INTEGRATE_REVIEW=#39894 from sergiitk:python-fix-reconnect 239b330
PiperOrigin-RevId: 773549056
sreenithi pushed a commit to sreenithi/grpc that referenced this pull request Jun 23, 2025
…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 pushed a commit to sreenithi/grpc that referenced this pull request Jun 23, 2025
…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 pushed a commit to sreenithi/grpc that referenced this pull request Jun 23, 2025
…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 pushed a commit to sreenithi/grpc that referenced this pull request Jun 23, 2025
…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 pushed a commit that referenced this pull request Jun 23, 2025
…sues: use iomgr backup poller when EE is disabled (v1.73.x backport) (#39950)

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.

Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
anniefrchz pushed a commit to anniefrchz/grpc that referenced this pull request Jun 25, 2025
…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
sergiitk added a commit that referenced this pull request Jun 26, 2025
…sues: use iomgr backup poller when EE is disabled (v1.72.x backport) (#39949)

Backport of #39894 to v1.72.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.

Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
sergiitk added a commit that referenced this pull request Jun 26, 2025
…sues: use iomgr backup poller when EE is disabled (#39948)

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.

Co-authored-by: Sergii Tkachenko <sergiitk@google.com>
sergiitk added a commit to sergiitk/grpc that referenced this pull request Jun 26, 2025
…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
paulosjca pushed a commit to paulosjca/grpc that referenced this pull request Aug 23, 2025
…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
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.

5 participants