Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

IllegalThreadStateException: Expected thread 2 ("main"), but running on thread 777 ("DefaultDispatcher-worker-4") #15436

Closed
grigoryk opened this issue Sep 25, 2020 · 3 comments
Assignees
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info Feature:Tabs

Comments

@grigoryk
Copy link
Contributor

grigoryk commented Sep 25, 2020

https://sentry.prod.mozaws.net/operations/firefox-nightly/issues/9650035/?referrer=github_plugin

IllegalThreadStateException: Expected thread 2 ("main"), but running on thread 777 ("DefaultDispatcher-worker-4")
    at org.mozilla.fenix.browser.BaseBrowserFragment.initializeEngineView(BaseBrowserFragment.kt:5)
    at org.mozilla.fenix.browser.BaseBrowserFragment.fullScreenChanged(BaseBrowserFragment.kt:30)
    at org.mozilla.fenix.browser.BaseBrowserFragment.access$fullScreenChanged(BaseBrowserFragment.kt:1)
    at org.mozilla.fenix.browser.BaseBrowserFragment$initializeUI$$inlined$also$lambda$20.onSessionSelected(BaseBrowserFragment.kt:1)
    at org.mozilla.fenix.HomeActivity$onResume$2.invokeSuspend(HomeActivity.kt:19)
...
(18 additional frame(s) were not displayed)

Expected thread 2 ("main"), but running on thread 777 ("DefaultDispatcher-worker-4")

┆Issue is synchronized with this Jira Task

@github-actions github-actions bot added the needs:triage Issue needs triage label Sep 25, 2020
@grigoryk
Copy link
Contributor Author

From the stacktrace, the root cause here is that in HomeActivity@onResume we're removing tabs on a background thread, which will end up triggering a session switch and bunch of "must be on a UI thread" work (e.g. setDynamicToolbarMaxHeight)

Introduced by #13886

@grigoryk grigoryk added b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info Feature:Tabs and removed needs:triage Issue needs triage labels Sep 25, 2020
@grigoryk
Copy link
Contributor Author

cc @ekager

@grigoryk grigoryk self-assigned this Sep 25, 2020
@grigoryk grigoryk added this to 🏃‍♀️ In Progress in A-C: Android Components Sprint Planning Sep 25, 2020
grigoryk pushed a commit to grigoryk/fenix that referenced this issue Sep 25, 2020
@grigoryk
Copy link
Contributor Author

Sentry issue: FIREFOX-NIGHTLY-7Z7

@ekager ekager closed this as completed in 24985d5 Sep 25, 2020
A-C: Android Components Sprint Planning automation moved this from 🏃‍♀️ In Progress to 🏁 Done Sep 25, 2020
grigoryk pushed a commit to grigoryk/fenix that referenced this issue Sep 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
b:crash Crashes Fenix: should link to Sentry, Crash-Stats or GPlay info Feature:Tabs
Projects
No open projects
Development

No branches or pull requests

1 participant