Skip to content

services: Do not inherit the caller Context in the health-check RPC - #13181

Open
Martozar wants to merge 1 commit into
grpc:masterfrom
Martozar:health-check-root-context
Open

Martozar wants to merge 1 commit into
grpc:masterfrom
Martozar:health-check-root-context

Conversation

@Martozar

Copy link
Copy Markdown

HealthCheckingLoadBalancerFactory created the Health.Watch call with whatever Context was current on the thread that drained the SynchronizationContext. That thread can be serving an unrelated RPC, so the end of that RPC cancelled the health-check stream. The immediate restart ran in the cancelled Context too and failed before any response, which put every such subchannel into TRANSIENT_FAILURE until the backoff expired.

Create the call under Context.ROOT, as GrpcXdsTransportFactory does for the xDS stream.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: Martozar / name: mikezelenskyy (f8199a0)

HealthCheckingLoadBalancerFactory created the Health.Watch call with
whatever Context was current on the thread that drained the
SynchronizationContext. That thread can be serving an unrelated RPC, so
the end of that RPC cancelled the health-check stream. The immediate
restart ran in the cancelled Context too and failed before any
response, which put every such subchannel into TRANSIENT_FAILURE until
the backoff expired.

Create the call under Context.ROOT, as GrpcXdsTransportFactory does for
the xDS stream.
@Martozar
Martozar force-pushed the health-check-root-context branch from 9889b3f to f8199a0 Compare November 10, 2026 10:25
@Martozar

Copy link
Copy Markdown
Author

/easycla

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant