firebase-android-sdk icon indicating copy to clipboard operation
firebase-android-sdk copied to clipboard

Custom fetchTimeout for Remote Config is ignored

Open adam2603 opened this issue 2 years ago • 11 comments

[READ] Step 1: Are you in the right place?

Issues filed here should be about bugs in the code in this repository. If you have a general question, need help debugging, or fall into some other category use one of these other channels:

  • For general technical questions, post a question on StackOverflow with the firebase tag.
  • For general Firebase discussion, use the firebase-talk google group.
  • For help troubleshooting your application that does not fall under one of the above categories, reach out to the personalized Firebase support channel.

[REQUIRED] Step 2: Describe your environment

  • Android Studio version: Android Studio Arctic Fox | 2020.3.1 Patch 3
  • Firebase Component: Remote Config
  • Component version: 21.0.1

[REQUIRED] Step 3: Describe the problem

I set firebase remote config fetch timeout to 5 seconds, but it is ignored and default one (60 seconds) is used. To test this I setup charles proxy with following throttling configuration: Screenshot 2021-10-20 at 12 29 08

Steps to reproduce:

  1. Setup proxy to delay all communication for 100 seconds
  2. Run app with timeout set to 5 seconds
  3. FirebaseRemoteConfig.fetch blocks for around 60 seconds

Relevant Code:

val firebaseRemoteConfig = FirebaseRemoteConfig.getInstance()
firebaseRemoteConfig.setConfigSettingsAsync(
    FirebaseRemoteConfigSettings.Builder()
        .setFetchTimeoutInSeconds(5)
        .build()
).await()
firebaseRemoteConfig.fetch(remoteConfigFetchInterval).await()
firebaseRemoteConfig.activate().await()

private fun <T> Task<T>.await() = Tasks.await(this)

adam2603 avatar Oct 20 '21 16:10 adam2603

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

google-oss-bot avatar Oct 20 '21 16:10 google-oss-bot

Hi @adam2603 thanks for reporting. I'll try to replicate this and see what we can do here.

aguatno avatar Oct 21 '21 18:10 aguatno

Hi @adam2603, just bumping this thread. I was able to replicate the issue, I'll try to notify an engineer and see what we can do here.

argzdev avatar Nov 15 '21 15:11 argzdev

Any news about this? I might be experiencing the same issue.

RomeuG avatar Dec 26 '21 22:12 RomeuG

Encountering same issue.

MatthiasDh avatar Apr 19 '22 08:04 MatthiasDh

Hi all, upon testing this code snippet on the latest version 21.0.2 it seems to work properly. Could you verify if you're still experiencing this issue @adam2603.

@MatthiasDh, could you add more details such as steps to repro or minimal repro of your issue?

argzdev avatar Apr 25 '22 14:04 argzdev

Hey @adam2603. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar May 02 '22 01:05 google-oss-bot

@argzdev I'm still experiencing this issue after upgrade to version 21.0.2

adam2603 avatar May 06 '22 09:05 adam2603

Hi, is there any solution?

abdulkadirgun avatar Sep 09 '22 12:09 abdulkadirgun

Also experiencing this issue - any solution?

andrew-just14 avatar Sep 14 '22 19:09 andrew-just14

Thanks for the reports @abdulkadirgun @andrew-just14 @adam2603. I'm wondering if you're seeing the timeout ignored outside of using Charles to increase the latency?

We control the timeout using URLConnection's setConnectTimeout and setReadTimeout, so it's possible something is returned that satisfies those "connection opened" and "started to read" requirements, but the round trip latency causes the connect to still hang open beyond those two limits.

danasilver avatar Sep 14 '22 19:09 danasilver

Hey @adam2603. We need more information to resolve this issue but there hasn't been an update in 5 weekdays. I'm marking the issue as stale and if there are no new updates in the next 5 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Oct 31 '22 01:10 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@adam2603 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Nov 07 '22 02:11 google-oss-bot

This is still happening - at least on 21.2.0. Sometimes (very very rarely) each fetchAndActivate() takes 20 seconds on my Pixel 4a. No amount of process restarts will fix it. It just takes 20 seconds every time. Setting setFetchTimeoutInSeconds() to for example 5 seconds doesn't help at all. It seems that the Firebase service is somehow "stuck", maybe the connection works as expected but some other parts of the Firebase Config code now cause a large delay. Rebooting my device has fixed the huge 20+ second delays. So this confirms that it's a Firebase service issue on the device (since uninstalls or process restarts didn't fix it, only device reboot).

DanielNovak avatar Dec 05 '22 18:12 DanielNovak