Skip to content

Commit b11b0fa

Browse files
buenaflorclaude
andcommitted
fix(extend-app-start): Make shouldSendStartMeasurements volatile
It is written without a lock in onAppStartSpansSent() and read across threads in canExtendAppStart() (via extendAppStart()), with no happens-before edge. volatile guarantees visibility, matching the AtomicInteger/AtomicBoolean siblings in the same check. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent bdadd2b commit b11b0fa

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sentry-android-core/src/main/java/io/sentry/android/core/performance/AppStartMetrics.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public enum AppStartType {
8787
private @Nullable IContinuousProfiler appStartContinuousProfiler = null;
8888
private @Nullable TracesSamplingDecision appStartSamplingDecision = null;
8989
private boolean isCallbackRegistered = false;
90-
private boolean shouldSendStartMeasurements = true;
90+
private volatile boolean shouldSendStartMeasurements = true;
9191
private final AtomicInteger activeActivitiesCounter = new AtomicInteger();
9292
private final AtomicBoolean firstDrawDone = new AtomicBoolean(false);
9393
private final AtomicBoolean headlessAppStartCheckPending = new AtomicBoolean(false);

0 commit comments

Comments
 (0)