Skip to content

Multiple crashes in Sentry related to SDK & fetching flags #316

@felislynx-silae

Description

@felislynx-silae

Describe the bug
I noticed multiple crash reports on Sentry from LaunchDarkly SDK:
Exception when fetching flags - java.net.UnknownHostException: Unable to resolve host "clientsdk.launchdarkly.com": No address associated with hostname

To reproduce
Unknown

Expected behavior
SDK should handle all exceptions internally and not cause application to crash

SDK version
5.9.1

Language version, developer tools
Kotlin 2.2.20

OS/platform
Android 12, Android 13, Android 14 and Android 15

Additional context
It happens on random, can't reproduce by turning off internet.
Status listener is set:

ldClient?.registerStatusListener(
                object : LDStatusListener {
                    override fun onConnectionModeChanged(connectionInformation: ConnectionInformation?) {
                        Logger.i("Mode changed: $connectionInformation", "LaunchDarkly")
                    }

                    override fun onInternalFailure(error: LDFailure?) {
                        Logger.i("Error: $error", "LaunchDarkly")
                    }
                },
            )

Code that fetches flag value:

 ldClient?.registerFeatureFlagListener(
            "CustomFlag",
            {
                val newValue = ldClient?.boolVariation("CustomFlag", false)
                Logger.i(
                    "UPDATE: Flag CustomFlag:false:Fetched $newValue",
                    "LaunchDarkly",
                )
            },
        )
        val newValue = ldClient?.boolVariation("CustomFlag", false)
        Logger.i("CURRENT Flag CustomFlag:false:Fetched $newValue", "LaunchDarkly")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions