Skip to content

Commit 270b8d6

Browse files
authored
Merge branch 'main' into fix-trace-metric-byte-data-category
2 parents 1e18411 + 83277d1 commit 270b8d6

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
- Add `trace_metric_byte` data category and record byte-level client reports when trace metrics are discarded ([#5626](https://github.com/getsentry/sentry-java/pull/5626))
88

9+
### Fixes
10+
11+
- 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))
12+
913
## 8.47.0
1014

1115
### Behavioral Changes

sentry-android-core/src/main/java/io/sentry/android/core/DefaultAndroidEventProcessor.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.concurrent.Executors;
2828
import java.util.concurrent.Future;
2929
import java.util.concurrent.RejectedExecutionException;
30+
import java.util.concurrent.ThreadFactory;
3031
import org.jetbrains.annotations.NotNull;
3132
import org.jetbrains.annotations.Nullable;
3233
import org.jetbrains.annotations.TestOnly;
@@ -56,7 +57,8 @@ public DefaultAndroidEventProcessor(
5657
// noinspection Convert2MethodRef
5758
// some device info performs disk I/O, but it's result is cached, let's pre-cache it
5859
@Nullable Future<DeviceInfoUtil> deviceInfoUtil;
59-
final @NotNull ExecutorService executorService = Executors.newSingleThreadExecutor();
60+
final @NotNull ExecutorService executorService =
61+
Executors.newSingleThreadExecutor(new DeviceInfoCacheThreadFactory());
6062
try {
6163
deviceInfoUtil =
6264
executorService.submit(() -> DeviceInfoUtil.getInstance(this.context, options));
@@ -425,4 +427,13 @@ private void setSideLoadedInfo(final @NotNull SentryBaseEvent event) {
425427
public @Nullable Long getOrder() {
426428
return 8000L;
427429
}
430+
431+
private static final class DeviceInfoCacheThreadFactory implements ThreadFactory {
432+
@Override
433+
public @NotNull Thread newThread(final @NotNull Runnable r) {
434+
final Thread ret = new Thread(r, "SentryDeviceInfoCache");
435+
ret.setDaemon(true);
436+
return ret;
437+
}
438+
}
428439
}

0 commit comments

Comments
 (0)