diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java index 6e568748a870..77a29901c995 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/FirestoreImpl.java @@ -29,6 +29,7 @@ import com.google.cloud.firestore.spi.v1.FirestoreRpc; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableMap; +import com.google.common.util.concurrent.MoreExecutors; import com.google.firestore.v1.BatchGetDocumentsRequest; import com.google.firestore.v1.BatchGetDocumentsResponse; import com.google.firestore.v1.DatabaseRootName; @@ -339,9 +340,11 @@ public void onSuccess(List writeResults) { span.end(); resultFuture.set(userResult); } - }); + }, + MoreExecutors.directExecutor()); } - }); + }, + MoreExecutors.directExecutor()); } private SettableApiFuture invokeUserCallback() { @@ -396,12 +399,14 @@ public void onFailure(Throwable throwable) { public void onSuccess(Void ignored) { resultFuture.setException(throwable); } - }); + }, + MoreExecutors.directExecutor()); } else { resultFuture.setException(throwable); } } - }); + }, + MoreExecutors.directExecutor()); } /** Returns whether the user has opted into receiving dates as com.google.cloud.Timestamp. */ diff --git a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/spi/v1/GrpcFirestoreRpc.java b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/spi/v1/GrpcFirestoreRpc.java index 451eb6c8e593..d2fee1507c3a 100644 --- a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/spi/v1/GrpcFirestoreRpc.java +++ b/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/spi/v1/GrpcFirestoreRpc.java @@ -85,7 +85,7 @@ public GrpcFirestoreRpc(final FirestoreOptions options) throws IOException { || NoCredentials.getInstance().equals(options.getCredentials())) { ManagedChannel managedChannel = ManagedChannelBuilder.forTarget(options.getHost()) - .usePlaintext(true) + .usePlaintext() .executor(executor) .build(); TransportChannel transportChannel = GrpcTransportChannel.create(managedChannel);