mirror of https://github.com/grpc/grpc.git
[GCP auth filter] hold ref to service config (#37831)
This fixes the following crash:
https://btx.cloud.google.com/invocations/3a7065d4-db7f-4f01-a239-5376b7f5ee8b/targets/%2F%2Ftest%2Fcpp%2Fend2end%2Fxds:xds_gcp_authn_end2end_test@experiment%3Dwork_serializer_dispatch;config=1a7dc092b28796b045d00aec96c95b85c1d4dc656912e0021a1fc84b3ecb2ac9/log
The problem is caused by a race whereby the channel swaps out the service config due to a resolver update while the old dynamic filter stack is still processing calls in another thread. The GCP auth filter was dereferencing the old service config but not holding a ref to it. I've fixed this by having it hold a ref.
In the long run, I suspect that we may run into other cases like this, in which case we may want the dynamic filter stack itself to hold a ref to the service config, so that individual filters don't have to.
Closes #37831
COPYBARA_INTEGRATE_REVIEW=https://github.com/grpc/grpc/pull/37831 from markdroth:gcp_auth_race_fix f2a0d1dd79
PiperOrigin-RevId: 681221795
pull/37683/head
parent
b44de399c1
commit
cd129b49c2
2 changed files with 11 additions and 4 deletions
Loading…
Reference in new issue