Skip to content

Commit 6d4e33b

Browse files
romtsnclaude
andcommitted
Fix leak in ReplayIntegration due to persisting executor not being shut down
Add the persistingExecutor argument to SessionCaptureStrategy and BufferCaptureStrategy constructor calls in tests, and add changelog entry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 856e99f commit 6d4e33b

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## Unreleased
44

5+
<<<<<<< HEAD
56
### Behavioral Changes
67

78
- `SentryOkHttpInterceptor::intercept` now throws `IOException`. This is a source-only and Java-only breaking change ([#5654](https://github.com/getsentry/sentry-java/pull/5654))
@@ -11,6 +12,7 @@
1112
- Don't start a redundant UI interaction transaction when a transaction is already bound to the Scope ([#5491](https://github.com/getsentry/sentry-java/issues/5491))
1213
- Previously, `SentryGestureListener` always started a UI transaction and only afterwards skipped binding it to the Scope when a manually-bound transaction already existed, leaving the new transaction to be dropped as an idle transaction without children.
1314
- Fix potential NPE within `Scope.endSession()` ([#5657](https://github.com/getsentry/sentry-java/pull/5657))
15+
- Fix memory leak in `ReplayIntegration` due to persisting executor not being shut down ([#5627](https://github.com/getsentry/sentry-java/pull/5627))
1416

1517
### Performance
1618

sentry-android-replay/src/test/java/io/sentry/android/replay/ReplayIntegrationTest.kt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -754,6 +754,12 @@ class ReplayIntegrationTest {
754754
null
755755
}
756756
},
757+
mock {
758+
whenever(mock.submit(any<Runnable>())).doAnswer {
759+
(it.arguments[0] as Runnable).run()
760+
null
761+
}
762+
},
757763
) { _ ->
758764
fixture.replayCache
759765
}
@@ -1116,5 +1122,12 @@ class ReplayIntegrationTest {
11161122
null
11171123
}
11181124
},
1125+
persistingExecutor =
1126+
mock {
1127+
whenever(mock.submit(any<Runnable>())).doAnswer {
1128+
(it.arguments[0] as Runnable).run()
1129+
null
1130+
}
1131+
},
11191132
)
11201133
}

0 commit comments

Comments
 (0)