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
Could you provide the percentage of sessions encountering this as well as the daily active users that are running the affected version of your app?
We see that all cases occur on devices with Android 14, mostly on Samsung devices in more than 80% of cases.
Are you able to reproduce this locally?
I have not been able to replicate it locally.
Thanks for answering those questions. The Android 14 part is very helpful.
For our first question, we are looking for a percentage of sessions affected. Ex: 1 thousand sessions in a month, and 10 people hit the issue, that would be 1%. This is a useful number for us as it helps us evaluate if it is related to usage, execution order, or a race condition within the SDK.
Hi again @ravendanot. I have spent some time investigating this more.
Theory:
Events are used to drive most of the data you see about flag evaluations, experiments, and rollouts in the LaunchDarkly dashboard. Current theory here is that the SDK is attempting to clear out the queue of events and for some reason that is blocking. Best guess is internet/routing was available but then drops once the event flush task executes. I'm trying to reproduce this theory and may try to optimize the failure handling.
Questions:
Does this application operate in a firewalled environment where the events endpoint may be blocked? This may be leading to the event flush routine taking longer due to errors/retry logic.
Have you customized the events URL via the LDConfig? Normally this is not done unless you need to route events through a proxy.
You said approximately 33% of users are encountering this issue. Is your application used in an environment that is more likely to have intermittent internet connectivity when compared to most mobile applications?
Workaround options:
This may seem counter-intuitive, but you don't need to call close() if you are OK with not having those final events sent.
Instead of calling close(), call client.flush(). This will result in flush being attempted in a non-blocking manner, but ultimately if the application process is terminated before the thread that sends the events can execute, events may be dropped.
Are you able to see the duration of the ANR? I have been able to reproduce something similar for ~1 second related to the retry interval when sending events. Code is here.
Activity
tanderson-ld commentedon Oct 22, 2024
Thank you for reporting this.
Could you provide the percentage of sessions encountering this as well as the daily active users that are running the affected version of your app?
Are you able to reproduce this locally?
ravendanot commentedon Oct 23, 2024
Hello @tanderson-ld
Could you provide the percentage of sessions encountering this as well as the daily active users that are running the affected version of your app?
We see that all cases occur on devices with Android 14, mostly on Samsung devices in more than 80% of cases.
Are you able to reproduce this locally?
I have not been able to replicate it locally.
tanderson-ld commentedon Oct 23, 2024
Thanks for answering those questions. The Android 14 part is very helpful.
For our first question, we are looking for a percentage of sessions affected. Ex: 1 thousand sessions in a month, and 10 people hit the issue, that would be 1%. This is a useful number for us as it helps us evaluate if it is related to usage, execution order, or a race condition within the SDK.
ravendanot commentedon Oct 23, 2024
In the last 30 days, this ANR has occurred in 33% of users and has occurred more than 1,500 times
tanderson-ld commentedon Oct 23, 2024
That is many more than expected.
We will investigate.
ravendanot commentedon Oct 23, 2024
The last thing that was done was the migration of the sdk, from v3.1.1 to v5.3.0. But I don't have the data from when we did the update.
tanderson-ld commentedon Nov 5, 2024
Hi again @ravendanot. I have spent some time investigating this more.
Theory:
Events are used to drive most of the data you see about flag evaluations, experiments, and rollouts in the LaunchDarkly dashboard. Current theory here is that the SDK is attempting to clear out the queue of events and for some reason that is blocking. Best guess is internet/routing was available but then drops once the event flush task executes. I'm trying to reproduce this theory and may try to optimize the failure handling.
Questions:
Workaround options:
close(), callclient.flush(). This will result in flush being attempted in a non-blocking manner, but ultimately if the application process is terminated before the thread that sends the events can execute, events may be dropped.tanderson-ld commentedon Nov 5, 2024
Are you able to see the duration of the ANR? I have been able to reproduce something similar for ~1 second related to the retry interval when sending events. Code is here.
ravendanot commentedon Nov 7, 2024
Hello @tanderson-ld.
We have not been able to see the duration of the ANR. I am going to try
client.flush()solution and see the behavior.tanderson-ld commentedon Nov 7, 2024
Sounds good, please let us know if that ends up resolving the issue. I still think we will try to make a fix, but will wait for your result.
feat(events): summarize and buffer events on the recording thread (ti…