File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
binder/src/main/java/io/grpc/binder/internal Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -673,13 +673,16 @@ private void preAuthorizeServer() {
673673 Attributes eagAttrs = checkNotNull (attributes .get (GrpcAttributes .ATTR_CLIENT_EAG_ATTRS ));
674674 ServiceInfo serviceInfo = eagAttrs .get (ApiConstants .TARGET_SERVICE_INFO );
675675 if (serviceInfo == null ) {
676- // It's unlikely, but the identity of the server could change by the time we actually
677- // bind/connect. It doesn't matter though, because:
678- // - if pre-auth fails, grpc-core will eventually retry against the replacement server.
679- // - even if pre-auth succeeds, we'll check the SecurityPolicy again in SETUP_TRANSPORT
680- // against the actual/new server's identity.
681676 serviceInfo = serviceBinding .resolve ();
682677 }
678+
679+ // It's unlikely, but in theory the server identity/existence represented by this ServiceInfo
680+ // could change by the time we actually bind/connect. It doesn't matter though, because:
681+ // - If pre-auth fails (but would succeed for the new identity), grpc-core will retry
682+ // against the replacement server using a new instance of BinderClientTransport.
683+ // - If pre-auth succeeds (but would fail for the new identity), we might incorrectly bind
684+ // to an unauthorized server, but we'll check the SecurityPolicy again in SETUP_TRANSPORT
685+ // against the actual/new server's identity.
683686 if (serviceInfo == null ) {
684687 preAuthResultFuture =
685688 Futures .immediateFuture (
You can’t perform that action at this time.
0 commit comments