Comments (2)
I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
from firebase-admin-python.
Hi @filippotp,
Thanks for reporting the issue!
According to the answers in https://stackoverflow.com/questions/53765366/urllib3-connectionpool-connection-pool-is-full-discarding-connection, seeing WARNING:urllib3.connectionpool:Connection pool is full, discarding connection: fcm.googleapis.com. Connection pool size: 10
does not mean that there is any problem with messaging.send_each_for_multicast()
. As long as messaging.send_each_for_multicast()
returns a BatchResponse
without any failures in it, then the multicast_message
should be sent to all the tokens successfully.
Here's the reason why those warnings only show up in the logs when messaging.send_each_for_multicast()
is used:
Unlike messaging.send_multicast
, the underlying implementation of messaging.send_each_for_multicast()
uses concurrent.futures.ThreadPoolExecutor
to start multiple threads to send to tokens via urllib3
in parallel. We set the maximum number of threads that ThreadPoolExecutor
can start, that is max_workers
, to the number of the tokens in the multicast_message
. That means if a multicast_message
contains 50 tokens, then ThreadPoolExecutor
may start at most 50 threads. However, the maxsize
for urllib3.connectionpool
is not configured so it is the default value, 10. Then https://stackoverflow.com/a/66671026 helps explain everything:
For example, if your maxsize is 10 (the default when using urllib3 via requests), and you launch 50 requests in parallel, those 50 connections will be performed at once, and after completion only 10 will remain in the pool while 40 will be discarded (and issue that warning).
So if you only send multicast_message
with no more than 10 tokens, I think the warning logs should be gone. However, the warning logs don't really matter. messaging.send_each_for_multicast()
should still work properly regardless of the warnings. We may optimize the implementation of messaging.send_each_for_multicast()
to start less threads in the future and may be able to get rid of those warnings, but before that happens, please continue migrating to messaging.send_each_for_multicast()
.
from firebase-admin-python.
Related Issues (20)
- Transaction contextmanager does not set transaction to in_progress HOT 2
- python-jwt is deprecated HOT 2
- firebase_admin installed and got PyJWKClient issue HOT 2
- [FR] Download url like with node js client HOT 1
- Github Desktop Pull/Push Issue HOT 2
- [FR] Adding global var HOT 1
- Option to pass values to the transaction function callback HOT 1
- auth.verify_id_token throwing ValueError HOT 1
- [FR] Add Support for Pyodide by providing a wheel with binaries built for Emscripten. HOT 2
- [FR] Add WebApps support to project_management HOT 1
- Couldn't import app_check HOT 1
- Firebase functions container silently freezes on making a get request to Firestore if multiple requests were created before container starts HOT 3
- Call to Firestore getting timed out from the docker container. HOT 1
- Querying Firestore documents by nested key-value in an array field using Python HOT 1
- firestore times out when using default DNS resolver HOT 1
- [FR] Async `messaging` requests HOT 1
- import firebase admin HOT 3
- Using cloud run from gcp console to firebase HOT 1
- Cloud run from gcp console HOT 2
- [FR][FCM] HTTP2 support for sendEach HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-admin-python.