Skip to content

Conversation

@ejona86
Copy link
Member

@ejona86 ejona86 commented Dec 4, 2025

Since ChildPolicyWrapper() called into the child before childPolicyMap.put(), it is possible for that child to call back into RLS and further update state without that child being known. When CDS is_dynamic=true (since ca99a8c), it registers the cluster with XdsDependencyManager, which adds a watch to XdsClient. If XdsClient already has the results cached then the watch callback can be enqueued immediately onto the syncContext and execute still within the constructor.

Calling into the child with the lock held isn't great, as it allows for this type of reentrancy bug. But that'll take larger changes to fix.

b/464116731

Backport of #12546

Since ChildPolicyWrapper() called into the child before
childPolicyMap.put(), it is possible for that child to call back into
RLS and further update state without that child being known. When CDS
is_dynamic=true (since ca99a8c), it registers the cluster with
XdsDependencyManager, which adds a watch to XdsClient. If XdsClient
already has the results cached then the watch callback can be enqueued
immediately onto the syncContext and execute still within the
constructor.

Calling into the child with the lock held isn't great, as it allows for
this type of reentrancy bug. But that'll take larger changes to fix.

b/464116731
@ejona86 ejona86 mentioned this pull request Dec 4, 2025
@ejona86 ejona86 merged commit bb07f79 into grpc:v1.76.x Dec 5, 2025
15 of 17 checks passed
@ejona86 ejona86 deleted the backport-rls-missed-update-1.76 branch December 5, 2025 17:00
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.

2 participants