Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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> deviceInfoUtil;
final @NotNull ExecutorService executorService = Executors.newSingleThreadExecutor();
final @NotNull ExecutorService executorService =
Executors.newSingleThreadExecutor(new DeviceInfoCacheThreadFactory());
try {
deviceInfoUtil =
executorService.submit(() -> DeviceInfoUtil.getInstance(this.context, options));
Expand Down Expand Up @@ -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;
}
}
}
Loading