Skip to content

Commit

Permalink
Always use offload executor in streams created with CallCredentialsAp…
Browse files Browse the repository at this point in the history
…plyingTransportFactory, never use the executor from CallCredentials in this case
  • Loading branch information
larry-safran committed Jun 25, 2022
1 parent 33fbb9d commit e2bf3d2
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 e2bf3d2

Please sign in to comment.