Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instabug spawns and keeps threads even when not initialized or disabled #461

Open
gpunto opened this issue Oct 25, 2023 · 2 comments
Open

Comments

@gpunto
Copy link

gpunto commented Oct 25, 2023

Steps to Reproduce the Problem

  1. Add Instabug as a dependency to a project without adding any initialization code
  2. Launch the app
  3. Check the existing threads, e.g. by debugging or by printing their names to the console

Expected Behavior

No Instabug thread exists if Instabug is not enabled.

Actual Behavior

Multiple Instabug threads exist. For example:

IBG-API-executor-0
IBG-SharedPrefs-0
IBG-core-io-executor-0
IBG-core-io-executor-1
IBG-v3-session-0

Instabug integration code

None. Adding an explicit call to Instabug.disable() yields the same behavior.

SDK Version

12.2.0

Android Version

Any.

Device Model

Any.

Project That Reproduces the Issue

I can upload a project if needed, but it would only contain these changes:

In the build script:

implementation("com.instabug.library:instabug:12.2.0")

In the Activity:

class MainActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        
        Instabug.disable()

        setContent {
            IBThreadsTheme {
                Button(onClick = {
                    Thread.getAllStackTraces().map { it.key.name }.sorted().forEach {
                        Log.i("hjkl", it)
                    }
                }) {
                    Text("Click")
                }
            }
        }
    }
}
@MohamedHefny
Copy link

Hey @gpunto, Thanks for reporting this.
Even if you didn't intialized Instabug yet I can see that you have been called the Instabug.disable() API which it's reasnoable to create some threads. However we will invistage more in the number of the created threads and get back to you soon.

@gpunto
Copy link
Author

gpunto commented Oct 25, 2023

Hey @MohamedHefny, thanks for the response!

Please note that even without any references to Instabug code (so even without the call to Instabug.disable()) the behavior is the same. I'm guessing the threads are spawned by a content provider when the app is created and are never terminated.

In any case, thanks again, let me know if you need any other info!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants