From 563086aa20d92c7d9e11800def1d56a878868027 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 2 Jul 2026 18:45:43 +0200 Subject: [PATCH 1/2] fix(android): Name the device-info caching thread DefaultAndroidEventProcessor created its device-info pre-caching executor via Executors.newSingleThreadExecutor() with no ThreadFactory, so the JDK named the thread pool-N-thread-M and it was not identifiable as an SDK thread. Supply a ThreadFactory that names it SentryDeviceInfoCache, matching the convention used elsewhere in the SDK. Co-Authored-By: Claude Opus 4.8 --- .../android/core/DefaultAndroidEventProcessor.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/sentry-android-core/src/main/java/io/sentry/android/core/DefaultAndroidEventProcessor.java b/sentry-android-core/src/main/java/io/sentry/android/core/DefaultAndroidEventProcessor.java index 7671935bb05..83f892573e4 100644 --- a/sentry-android-core/src/main/java/io/sentry/android/core/DefaultAndroidEventProcessor.java +++ b/sentry-android-core/src/main/java/io/sentry/android/core/DefaultAndroidEventProcessor.java @@ -27,6 +27,7 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.RejectedExecutionException; +import java.util.concurrent.ThreadFactory; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.TestOnly; @@ -56,7 +57,8 @@ public DefaultAndroidEventProcessor( // noinspection Convert2MethodRef // some device info performs disk I/O, but it's result is cached, let's pre-cache it @Nullable Future deviceInfoUtil; - final @NotNull ExecutorService executorService = Executors.newSingleThreadExecutor(); + final @NotNull ExecutorService executorService = + Executors.newSingleThreadExecutor(new DeviceInfoCacheThreadFactory()); try { deviceInfoUtil = executorService.submit(() -> DeviceInfoUtil.getInstance(this.context, options)); @@ -425,4 +427,13 @@ private void setSideLoadedInfo(final @NotNull SentryBaseEvent event) { public @Nullable Long getOrder() { return 8000L; } + + private static final class DeviceInfoCacheThreadFactory implements ThreadFactory { + @Override + public @NotNull Thread newThread(final @NotNull Runnable r) { + final Thread ret = new Thread(r, "SentryDeviceInfoCache"); + ret.setDaemon(true); + return ret; + } + } } From b5762bb10c6f445ef0a91bcd7013834cc3ba7752 Mon Sep 17 00:00:00 2001 From: Nelson Osacky Date: Thu, 2 Jul 2026 18:46:23 +0200 Subject: [PATCH 2/2] changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3a290e2b3e9..68ba41d95eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## Unreleased + +### Fixes + +- Name the device-info caching thread `SentryDeviceInfoCache` so all threads spawned by the SDK are identifiable ([#5684](https://github.com/getsentry/sentry-java/pull/5684)) + ## 8.47.0 ### Behavioral Changes