firebase / firebase-admin-node

Firebase Admin Node.js SDK
https://firebase.google.com/docs/admin/setup
Apache License 2.0
1.6k stars 359 forks source link

setConnectTimeout for firebase admin 8.12.1 #978

Open darshankaarki opened 3 years ago

darshankaarki commented 3 years ago

Does the firebase node admin ask have any connectTimeout property?

While sending notification to some of my registration token it takes more than 2 minutes and then times out. This is slowing down our process a lot.

google-oss-bot commented 3 years ago

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

hiranya911 commented 3 years ago

There's a 10s default timeout on all FCM requests. Unfortunately there's no way to configure or change it as of today.

darshankaarki commented 3 years ago

In my case it does not timeout in 10seconds but rather in 2 minutes. Can you help with why is it so?

I do not have any explicit retry mechanism? Is it something derived from node or express ? can you recommend of anything to reduce the timeout to 10s instead of 2 minutes?

hiranya911 commented 3 years ago

The 2 minute delay is probably coming from Express/Node.js due to a bad promise chain in your code. See https://github.com/expressjs/express/issues/3330 and https://nodejs.org/docs/latest-v8.x/api/http.html#http_server_timeout