Skip to content

[Backport][v1.78.x][Python] Align GRPC_ENABLE_FORK_SUPPORT env defaults in core and python#41588

Merged
sergiitk merged 1 commit intogrpc:v1.78.xfrom
sergiitk:backport-1.78-fix/py/fork-defaults
Feb 10, 2026
Merged

[Backport][v1.78.x][Python] Align GRPC_ENABLE_FORK_SUPPORT env defaults in core and python#41588
sergiitk merged 1 commit intogrpc:v1.78.xfrom
sergiitk:backport-1.78-fix/py/fork-defaults

Conversation

@sergiitk
Copy link
Member

Backport of #41455 to v1.78.x.

In the core, the default value of the GRPC_ENABLE_FORK_SUPPORT environment variable is determined by the value of the GRPC_ENABLE_FORK_SUPPORT_DEFAULT macro, which is by default derived from the value of the GRPC_ENABLE_FORK_SUPPORT macro. Python sets GRPC_ENABLE_FORK_SUPPORT, so the feature is enabled there by default. However, Python also reads the value of the GRPC_ENABLE_FORK_SUPPORT environment variable and sets its own default in fork_posix.pyx.pxi, and the feature is disabled there by default. The result is a mixed state that causes problems.

This change fixes that by disabling the feature by default in both places. In the long run we want to enable it by default everywhere, but for now we don't have confidence in its stability.

…on (grpc#41455)

In the core, the default value of the `GRPC_ENABLE_FORK_SUPPORT` environment variable is determined by the value of the `GRPC_ENABLE_FORK_SUPPORT_DEFAULT` macro, which is by default derived from the value of the `GRPC_ENABLE_FORK_SUPPORT` macro. Python sets `GRPC_ENABLE_FORK_SUPPORT`, so the feature is enabled there by default. However, Python also reads the value of the `GRPC_ENABLE_FORK_SUPPORT` environment variable and sets its own default in `fork_posix.pyx.pxi`, and the feature is disabled there by default. The result is a mixed state that causes problems.

This change fixes that by disabling the feature by default in both places. In the long run we want to enable it by default everywhere, but for now we don't have confidence in its stability.

Closes grpc#41455

COPYBARA_INTEGRATE_REVIEW=grpc#41455 from sergiitk:fix/py/fork-defaults 73be72d
PiperOrigin-RevId: 859928704
@sergiitk sergiitk self-assigned this Feb 10, 2026
@sergiitk sergiitk added lang/Python release notes: yes Indicates if PR needs to be in release notes labels Feb 10, 2026
Copy link
Member

@asheshvidyut asheshvidyut left a comment

Choose a reason for hiding this comment

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

LGTM

@sergiitk sergiitk merged commit de33c9c into grpc:v1.78.x Feb 10, 2026
55 of 58 checks passed
@sergiitk sergiitk deleted the backport-1.78-fix/py/fork-defaults branch February 10, 2026 15:39
@haoliangz
Copy link

The investigation was done via claude code. But the outage on our end was 1.78.0 -> 1.78.1 where we had a :latest tag on build pack which led us here.

This minor vision upgrade caused our google cloud run to hang. Not an expert here but if you guys have recommendation into what should be done OR if you guys should go a different route with how to fix the grpc packages

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

Labels

lang/Python release notes: yes Indicates if PR needs to be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants