googleapis / googleapis/google-cloud-java

[java-firestore] No way to access gRpc parameter from Firestore service api to fix deadline exceeded exception(Java)

Abierto
#13,145 2 comentarios 0 reacciones 1 asignado Reclamado por @suraj-qlogic Ver en GitHub
api: firestore type: question
Lenguaje dominante
Java
Estrellas
2.1k
Forks
1.2k
Merge medio
1 d 23 h
PR fusionados (30 d)
154

Descripción

Hi,

We try to load in a single-transaction batch lots of data into Firestore via the Java api. It works fine with smaller data. But, when the amount to upload to Google Cloud from remote gets large, we get from gRpc a deadline exceeded exception: see stack trace and pom.xml below.

We would like to change the deadline via
response = blockingStub.withDeadlineAfter(deadlineMs,TimeUnit.MILLISECONDS).sayHello(request);
as described in https://grpc.io/blog/deadlines/.

Any other way would do.

We have explored various alternatives:

1. FirestoreOptions.setServiceRpcFactory(serviceRpcFactory)

1. FirestoreOptions.setTransportOptions(transportOptions)

But none seems to lead to access of the gRpc parameters.

So, is there currently no way to change gRpc parameters when using Firestore?

Thanks!
DIdier

======= pom.xml dependencies =======

com.google.cloud
libraries-bom
4.2.0
pom

com.google.cloud
google-cloud-firestore

====== Java stack trace ==============

ava.util.concurrent.ExecutionException: com.google.api.gax.rpc.DeadlineExceededException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 49.999563145s. [remote_addr=firestore.googleapis.com/216.58.213.170:443]
at com.google.common.util.concurrent.AbstractFuture.getDoneValue(AbstractFuture.java:553)
at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:534)
at com.google.common.util.concurrent.FluentFuture$TrustedFuture.get(FluentFuture.java:86)
at com.google.common.util.concurrent.ForwardingFuture.get(ForwardingFuture.java:62)
at com.action.inputParser.RawDataInputParser.main(RawDataInputParser.java:412)
Caused by: com.google.api.gax.rpc.DeadlineExceededException: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 49.999563145s. [remote_addr=firestore.googleapis.com/216.58.213.170:443]
at com.google.api.gax.rpc.ApiExceptionFactory.createException(ApiExceptionFactory.java:51)
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:72)
at com.google.api.gax.grpc.GrpcApiExceptionFactory.create(GrpcApiExceptionFactory.java:60)
at com.google.api.gax.grpc.GrpcExceptionCallable$ExceptionTransformingFuture.onFailure(GrpcExceptionCallable.java:97)
at com.google.api.core.ApiFutures$1.onFailure(ApiFutures.java:68)
at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1039)
at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:30)
at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1165)
at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:958)
at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:749)
at io.grpc.stub.ClientCalls$GrpcFuture.setException(ClientCalls.java:522)
at io.grpc.stub.ClientCalls$UnaryStreamToFuture.onClose(ClientCalls.java:497)
at io.grpc.internal.ClientCallImpl.closeObserver(ClientCallImpl.java:426)
at io.grpc.internal.ClientCallImpl.access$500(ClientCallImpl.java:66)
at io.grpc.internal.ClientCallImpl$1CloseInContext.runInContext(ClientCallImpl.java:416)
at io.grpc.internal.ContextRunnable.run(ContextRunnable.java:37)
at io.grpc.internal.SerializingExecutor.run(SerializingExecutor.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: io.grpc.StatusRuntimeException: DEADLINE_EXCEEDED: deadline exceeded after 49.999563145s. [remote_addr=firestore.googleapis.com/216.58.213.170:443]
at io.grpc.Status.asRuntimeException(Status.java:533)
... 13 more

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.