Skip to content

Commit

Permalink
core: Always pass offload executor to CallCredentials. never use the …
Browse files Browse the repository at this point in the history
…executor from CallOptions (#9313)
  • Loading branch information
larry-safran committed Jun 28, 2022
1 parent 957d4e8 commit b361ecf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -144,8 +144,7 @@ public Attributes getTransportAttrs() {
}
};
try {
creds.applyRequestMetadata(
requestInfo, firstNonNull(callOptions.getExecutor(), appExecutor), applier);
creds.applyRequestMetadata(requestInfo, appExecutor, applier);
} catch (Throwable t) {
applier.fail(Status.UNAUTHENTICATED
.withDescription("Credentials should use fail() instead of throwing exceptions")
Expand Down
Expand Up @@ -168,7 +168,7 @@ public void parameterPropagation_overrideByCallOptions() {

ArgumentCaptor<RequestInfo> infoCaptor = ArgumentCaptor.forClass(null);
verify(mockCreds).applyRequestMetadata(infoCaptor.capture(),
same(anotherExecutor), any(CallCredentials.MetadataApplier.class));
same(mockExecutor), any(CallCredentials.MetadataApplier.class));
RequestInfo info = infoCaptor.getValue();
assertSame(transportAttrs, info.getTransportAttrs());
assertSame(method, info.getMethodDescriptor());
Expand Down Expand Up @@ -212,7 +212,7 @@ public void parameterPropagation_callOptionsSetAuthority() {

ArgumentCaptor<RequestInfo> infoCaptor = ArgumentCaptor.forClass(null);
verify(mockCreds).applyRequestMetadata(
infoCaptor.capture(), same(anotherExecutor),
infoCaptor.capture(), same(mockExecutor),
any(io.grpc.CallCredentials.MetadataApplier.class));
RequestInfo info = infoCaptor.getValue();
assertSame(method, info.getMethodDescriptor());
Expand Down

0 comments on commit b361ecf

Please sign in to comment.