[EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled#39894
[EventEngine] Fix Python reconnect issues: use iomgr backup poller when EE is disabled#39894sergiitk wants to merge 5 commits intogrpc:masterfrom
Conversation
d18e518 to
0343576
Compare
c86618f to
17d1c95
Compare
17d1c95 to
5f70540
Compare
2365111 to
e806e6e
Compare
e806e6e to
d0fc3be
Compare
sreenithi
left a comment
There was a problem hiding this comment.
LGTM, great work! Thanks for working on this!
| static bool g_backup_polling_disabled; | ||
|
|
||
| void grpc_client_channel_global_init_backup_polling() { | ||
| #if GRPC_PLATFORM_SUPPORTS_POSIX_POLLING |
There was a problem hiding this comment.
I suspect you'll want to use the GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER macro instead. This change will otherwise make no difference on, say, Linux.
There was a problem hiding this comment.
@eugeneo recommended it with the comment
I think Python backup poller woes would be alleviated if there was a check "and poller is not disabled" here:
This should retain the original behavior for Python and iOS.
From what I checked, GRPC_PLATFORM_SUPPORTS_POSIX_POLLING will always be false when GRPC_DO_NOT_INSTANTIATE_POSIX_POLLER is defined:
grpc/src/core/lib/event_engine/posix_engine/posix_engine.cc
Lines 73 to 78 in f4e6c6b
Please let me know what you think, I'm fine either way.
There was a problem hiding this comment.
Some C++ knowledge you may be missing: That #define will only hold for that translation unit (i.e, it only applies to that cc file). The backup poller code will never see a #define made in posix_engine.cc, it's intended to be internal.
There was a problem hiding this comment.
Some C++ knowledge you may be missing
Most of it is missing, haha. I do cpp very occasionally. I guess I'll be changing now.
The backup poller code will never see a #define made in posix_engine.cc, it's intended to be internal.
@eugeneo - curious what was you reasoning to use GRPC_PLATFORM_SUPPORTS_POSIX_POLLING then
|
Internal ref: b/420745567 |
…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
…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
…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
…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
…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>
…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
…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>
…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>
…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
…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
Fix the issue with gRPC Python Client not recovering in certain situations: #38290, #39113, #39631.
This PR:
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_POLLINGdue 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_POLLERfrom 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.