rls: Avoid missed config update from reentrancy · grpc/grpc-java@55ae1d0 · GitHub
Skip to content

Commit 55ae1d0

Browse files
committed
rls: Avoid missed config update from reentrancy
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
1 parent 53a0926 commit 55ae1d0

2 files changed

Lines changed: 29 additions & 12 deletions

File tree

rls/src/main/java/io/grpc/rls/LbPolicyConfiguration.java

Lines changed: 5 additions & 2 deletions

rls/src/test/java/io/grpc/rls/LbPolicyConfigurationTest.java

Lines changed: 24 additions & 10 deletions

0 commit comments

Comments
 (0)