You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Breaking inside the transaction-handler, it seems to be called on the a "grpc-transport-X" thread. I would assume the intention, judging by TransactionRunner is to use the default executor from the service-instance. This seems to be a java.util.concurrent.ScheduledThreadPoolExecutor, configured with a maximumPoolSize of 2147483647, but in practice somehow limited to 8, probably being the cause of the problem.
The text was updated successfully, but these errors were encountered:
Dug a bit deeper. Turns out that since ScheduledThreadPoolExecutor is using an unbounded queue implementation, its "corePoolSize" is also its practicalmaximumPoolSize. So the pool running here really is bound to a maximum of 8 threads.
Looking at where this is used, in GrpcFirestoreRpc, it's both passed on as the actual Grpc-transport Executor, but also reused to drive all snapshotListeners and all transaction-callbacks (that don't explicitly use their own pool). This means that any callback-function to snapshot-listeners or transactions, are in practice also bound to a maximum of 8-concurrent. (Unless the GrpcTransportOptions are overriden during setup).
Unless this is by design, perhaps GrpcFirestoreOptions should have some "callbackExecutor", that does not need to be Scheduled, and perhaps default to Executors.newCachedThreadPool?
Steps to reproduce
Code example
External references such as API reference guides
https://cloud.google.com/firestore/docs/samples/firestore-transaction-document-update#firestore_transaction_document_update-java
Any additional information below
Breaking inside the transaction-handler, it seems to be called on the a "grpc-transport-X" thread. I would assume the intention, judging by TransactionRunner is to use the default executor from the service-instance. This seems to be a
java.util.concurrent.ScheduledThreadPoolExecutor
, configured with amaximumPoolSize
of 2147483647, but in practice somehow limited to 8, probably being the cause of the problem.The text was updated successfully, but these errors were encountered: