Firestore take long time to retrieve data after reconnecting to the Internet (Android)

2,937 views
Skip to first unread message

marm...@gmail.com

unread,
Jan 28, 2018, 11:03:34 AM1/28/18
to Firebase Google Group
Application take long time to retrieve any data from firestore in android application after disconnect internet and reconnect it. could i get any help

Michael Lehenbauer

unread,
Jan 31, 2018, 6:23:11 PM1/31/18
to Firebase Google Group
You'll need to provide more details about how you're disconnecting / reconnecting and the delays you're seeing. Most helpful would be if you can capture logs after call FirebaseFirestore.setLoggingEnabled(true).

On Sun, Jan 28, 2018 at 5:51 AM, <marm...@gmail.com> wrote:
Application take long time to retrieve any data from firestore in android application after disconnect internet and reconnect it. could i get any help

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/cb99ddad-41a3-4050-bf79-f65c6147a2c4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ism...@humbike.com

unread,
Feb 3, 2018, 11:23:13 AM2/3/18
to Firebase Google Group
Hi Michael,

I'm facing the same problem and can add some detail. I've enabled Firestore logging to see the issue.

Let's say I turn all network connections off on my phone. Then, Firestore will throw this error:

Stream closed with status: zzfof{code=UNAVAILABLE, description=null, cause=java.net.UnknownHostException: Unable to resolve host "firestore.googleapis.com": No address associated with hostname

(full stack trace omitted)

This is followed by:

Backing off for 31774ms (base delay: 25624ms)



This is to be expected: Firestore is disconnected, so the underlying gRPC stream is UNAVAILABLE.

The problem is when I turn mobile data on again. Ever other network-reliant service starts working within ~3s. However, Firestore continues to throw the above error for ~1min (this varies) at a regular interval. During this time, if I try to run a Firestore transaction, I get the following error...:

com.google.firebase.firestore.FirebaseFirestoreException: Transaction failed all retries.

...with the same "UnknownHostException" stack trace as described above. I can trigger the transaction as many times as I like, but it will still fail with this error even though all other network-reliant services are working just fine, and my device is connected to the internet.

Eventually (after ~1min), the logs will show:

[FirestoreCallCredentials]: Successfully fetched token.


After I see this in the logs, I can now successfully execute the Firestore transaction.

This is a really big problem, especially for users in developing markets. There, internet connections are spotty, and users toggle mobile data on/off regularly to conserve data. In these conditions, it is imperative that Firestore handle connectivity interruptions gracefully and speedily. Having to wait 1 whole minute to run a Firestore transaction is extremely disappointing, and forces me to switch to using Cloud Functions with HTTP Triggers as a stopgap solution.

Would be great to see if anyone else has found a solution to this... perhaps we can force Firestore to reconnect somehow? 


On Thursday, February 1, 2018 at 4:23:11 AM UTC+5, Michael Lehenbauer wrote:
You'll need to provide more details about how you're disconnecting / reconnecting and the delays you're seeing. Most helpful would be if you can capture logs after call FirebaseFirestore.setLoggingEnabled(true).
On Sun, Jan 28, 2018 at 5:51 AM, <marm...@gmail.com> wrote:
Application take long time to retrieve any data from firestore in android application after disconnect internet and reconnect it. could i get any help

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages