Title: SentryFrameMetricsCollector blocks the main thread in HandlerThread.getLooper() when the first activity transaction starts · Issue #6443 · getsentry/sentry-java · GitHub
Open Graph Title: SentryFrameMetricsCollector blocks the main thread in HandlerThread.getLooper() when the first activity transaction starts · Issue #6443 · getsentry/sentry-java
X Title: SentryFrameMetricsCollector blocks the main thread in HandlerThread.getLooper() when the first activity transaction starts · Issue #6443 · getsentry/sentry-java
Description: Integration sentry-android Build System Gradle AGP Version 9.2.1 Proguard Enabled Other Error Monitoring Solution No Version 8.60.0 Steps to Reproduce Use sentry-android 8.60.0 (same code in 8.61.0) with enablePerformanceV2 and enableFra...
Open Graph Description: Integration sentry-android Build System Gradle AGP Version 9.2.1 Proguard Enabled Other Error Monitoring Solution No Version 8.60.0 Steps to Reproduce Use sentry-android 8.60.0 (same code in 8.61.0...
X Description: Integration sentry-android Build System Gradle AGP Version 9.2.1 Proguard Enabled Other Error Monitoring Solution No Version 8.60.0 Steps to Reproduce Use sentry-android 8.60.0 (same code in 8.61.0...
Opengraph URL: https://github.com/getsentry/sentry-java/issues/6443
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"SentryFrameMetricsCollector blocks the main thread in HandlerThread.getLooper() when the first activity transaction starts","articleBody":"### Integration\n\nsentry-android\n\n### Build System\n\nGradle\n\n### AGP Version\n\n9.2.1\n\n### Proguard\n\nEnabled\n\n### Other Error Monitoring Solution\n\nNo\n\n### Version\n\n8.60.0\n\n### Steps to Reproduce\n\n1. Use sentry-android 8.60.0 (same code in 8.61.0) with `enablePerformanceV2` and `enableFramesTracking` on (the defaults) and activity tracing on.\n2. Cold start the app on a busy device, for example shortly after boot.\n3. Record a Perfetto trace of the cold start.\n4. Look at the main thread during the launcher activity's onCreate: it sits in `HandlerThread.getLooper()` under `SentryFrameMetricsCollector.startCollection`, called from `SpanFrameMetricsCollector.onSpanStarted` when `ActivityLifecycleIntegration` starts the activity transaction.\n\n### Expected Result\n\nStarting frame collection for the first activity transaction doesn't block the main thread.\n\n### Actual Result\n\n`SentryFrameMetricsCollector.ensureHandlerThreadStarted()` starts the `HandlerThread` and then calls `getLooper()`, which blocks the main thread until the new thread is running. In our trace this took 308 ms during the launcher activity's onCreate. Since #5641 (8.47.0) this wait happens at the first `startCollection()` call instead of during `SentryAndroid.init`, so it moved to `Activity.onCreate` rather than going away.\n\n\u003cimg width=\"1094\" height=\"120\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/3ab4e4dd-ddd7-4fa5-969c-ade311bee979\" />","author":{"url":"https://github.com/ikerfah","@type":"Person","name":"ikerfah"},"datePublished":"2026-11-02T09:57:44Z","url":"https://github.com/getsentry/sentry-java/issues/6443"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e7e00670-8e9d-5f9a-646c-84076e62c491 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AEA6:1C619:339B6E:49726A:6B046DAB |
| html-safe-nonce | 9eddb16e0107f9fe2bb10b1bfe6ba0fdbe1d2db336ebcac74d27c4f344c010a2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRUE2OjFDNjE5OjMzOUI2RTo0OTcyNkE6NkIwNDZEQUIiLCJ2aXNpdG9yX2lkIjoiMzYwMTIyMDc3MjU3Mzc2OTEzMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7a8fddec505cbe745095aaf22e65614eb40906bb0fca83ff4681f382f5138f8b |
| hovercard-subject-tag | issue:6160266956 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-java/6443/issue_layout |
| twitter:image | https://opengraph.githubassets.com/17ac6be9d3c24de64992c14b0ef6f884dcfa77f99a76fcf1d199c6b82e3ca4ee/getsentry/sentry-java/issues/6443 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/17ac6be9d3c24de64992c14b0ef6f884dcfa77f99a76fcf1d199c6b82e3ca4ee/getsentry/sentry-java/issues/6443 |
| og:image:alt | Integration sentry-android Build System Gradle AGP Version 9.2.1 Proguard Enabled Other Error Monitoring Solution No Version 8.60.0 Steps to Reproduce Use sentry-android 8.60.0 (same code in 8.61.0... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ikerfah |
| hostname | github.com |
| expected-hostname | github.com |
| None | ae8802492f12d3ba4f6b0d814054e617a2a5616b6327bf8555c10cd5b0dc2a6f |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-java git https://github.com/getsentry/sentry-java.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3368190 |
| octolytics-dimension-repository_nwo | getsentry/sentry-java |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3368190 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-java |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | cfb5f24c6e01d85f70804652a5107e5cac03a161 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width