launchdarkly / android-client-sdk

LaunchDarkly Client-side SDK for Android
Other
45 stars 23 forks source link

Excessive DNS lookout errors logged #169

Open VyshasDojo opened 2 years ago

VyshasDojo commented 2 years ago

Is this a support request? This issue tracker is maintained by LaunchDarkly SDK developers and is intended for feedback on the SDK code. If you're not sure whether the problem you are having is specifically related to the SDK, or to the LaunchDarkly service overall, it may be more appropriate to contact the LaunchDarkly support team; they can help to investigate the problem and will consult the SDK team if necessary. You can submit a support request by going here or by emailing support@launchdarkly.com.

Note that issues filed on this issue tracker are publicly accessible. Do not provide any private account information on your issues. If your problem is specific to your account, you should submit a support request as described above.

Describe the bug Errors are logged when app starts without network connections. The fix noted in https://github.com/launchdarkly/android-client-sdk/issues/107 is still not fixed in 3.1.1

Expected behavior ensure the logs are not spammed.

Logs Caused by java.net.UnknownHostException: Unable to resolve host "clientsdk.launchdarkly.com": No address associated with hostname at java.net.Inet6AddressImpl.lookupHostByName(Inet6AddressImpl.java:156) at java.net.Inet6AddressImpl.lookupAllHostAddr(Inet6AddressImpl.java:103) at java.net.InetAddress.getAllByName(InetAddress.java:1152) at okhttp3.Dns$Companion$DnsSystem.lookup(Dns.java:5) at okhttp3.internal.connection.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:32) at okhttp3.internal.connection.ExchangeFinder.findConnection(ExchangeFinder.java:32) at okhttp3.internal.connection.ExchangeFinder.findHealthyConnection(ExchangeFinder.java:32) at okhttp3.internal.connection.ExchangeFinder.find(ExchangeFinder.java:12) at okhttp3.internal.connection.RealCall.initExchange$okhttp(RealCall.java:12) at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:12) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:7) at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:127) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:7) at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:21) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:7) at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:26) at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:7) at okhttp3.internal.connection.RealCall.getResponseWithInterceptorChain$okhttp(RealCall.java:12) at okhttp3.internal.connection.RealCall$AsyncCall.run(RealCall.java:8) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) at java.lang.Thread.run(Thread.java:919)

SDK version 3.1.1

Language version, developer tools Kotlin , Android. OS/platform Android Additional context Add any other context about the problem here.

louis-launchdarkly commented 2 years ago

Hello @VyshasDojo, thank you for the report. We will continue the investigation of this issue as you noted v3.1.1. didn't seem to fix it.

Filed Internally as 155373

louis-launchdarkly commented 1 year ago

Edited: While we generally recommend updating to 4.0.0 when possible, we still need to look into this issue more.

richardleggett commented 1 year ago

Just to add, the out of the box configuration plants a Timber.Tree which for network related errors calls Android's Log.wtf(), which calls RuntimeInit.wtf() (due to Log.ASSERT level being the same as the LD level?).

This is being caught and reported by crash reporters such as Sentry. Generating millions of issues in Sentry when devices or LaunchDarkly servers have network issues, e.g.:

Using 4.2.0.