Skip to content

Conversation

@ejona86
Copy link
Member

@ejona86 ejona86 commented Dec 3, 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

@ejona86 ejona86 requested a review from kannanjgithub December 3, 2025 21:59
@ejona86 ejona86 added the TODO:backport PR needs to be backported. Removed after backport complete label Dec 3, 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TODO:backport PR needs to be backported. Removed after backport complete

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant