Skip to content

Conversation

romtsn
Copy link
Member

@romtsn romtsn commented Oct 7, 2025

📜 Description

  • We were calling pauseInternal in the case of no internet connection/rate-limit from the replayExecutor thread. However, this might be a heavy operation because we need to encode the current pending segment and therefore we'd be holding the lifecycleLock for too long. Moving checkCanRecord off the executor fixes this, because we no longer hold the lock for the entire encoding task, but just for submitting it to the executor

💡 Motivation and Context

Fixes getsentry/sentry-react-native#4838

💚 How did you test it?

There's no really easy way to unit test the ANR, so I just manually verified it's not deadlocking when encoding huge segments

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

lcian and others added 8 commits October 7, 2025 14:13
…ME-391) (#4773)

Removes the redundant main_binary_identifier parameter from the Build
Distribution API calls, as it was always set to the same value as app_id.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
Bumps [gradle/actions](https://github.com/gradle/actions) from 4.4.3 to 5.0.0.
- [Release notes](https://github.com/gradle/actions/releases)
- [Commits](gradle/actions@ed40850...4d9f0ba)

---
updated-dependencies:
- dependency-name: gradle/actions
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 3.30.5 to 3.30.6.
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](github/codeql-action@3599b3b...64d10c1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.30.6
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Roman Zavarnitsyn <rom4ek93@gmail.com>
@romtsn romtsn enabled auto-merge (squash) October 7, 2025 12:13
Copy link
Contributor

github-actions bot commented Oct 7, 2025

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 367.02 ms 437.38 ms 70.36 ms
Size 1.58 MiB 2.11 MiB 539.18 KiB

Baseline results on branch: main

Startup times

Revision Plain With Sentry Diff
806307f 357.85 ms 424.64 ms 66.79 ms
d217708 375.27 ms 415.68 ms 40.41 ms
ee747ae 374.71 ms 455.18 ms 80.47 ms
7314dbe 437.83 ms 505.64 ms 67.81 ms
3d205d0 352.15 ms 432.53 ms 80.38 ms
ee747ae 358.21 ms 389.41 ms 31.20 ms
d217708 355.34 ms 381.39 ms 26.05 ms
b3d8889 371.33 ms 426.24 ms 54.92 ms
d217708 409.83 ms 474.72 ms 64.89 ms
b750b96 421.25 ms 444.09 ms 22.84 ms

App size

Revision Plain With Sentry Diff
806307f 1.58 MiB 2.10 MiB 533.42 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
7314dbe 1.58 MiB 2.10 MiB 533.45 KiB
3d205d0 1.58 MiB 2.10 MiB 532.97 KiB
ee747ae 1.58 MiB 2.10 MiB 530.95 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
b3d8889 1.58 MiB 2.10 MiB 535.07 KiB
d217708 1.58 MiB 2.10 MiB 532.97 KiB
b750b96 1.58 MiB 2.10 MiB 533.20 KiB

Previous results on branch: rz/fix/session-replay-pause-anr

Startup times

Revision Plain With Sentry Diff
b323c6c 351.24 ms 416.90 ms 65.66 ms

App size

Revision Plain With Sentry Diff
b323c6c 1.58 MiB 2.11 MiB 539.03 KiB

Copy link
Member

@markushi markushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, LGTM!

@romtsn romtsn disabled auto-merge October 9, 2025 08:38
@romtsn romtsn enabled auto-merge (squash) October 9, 2025 08:38
@romtsn romtsn merged commit 9fbb112 into main Oct 9, 2025
59 of 60 checks passed
@romtsn romtsn deleted the rz/fix/session-replay-pause-anr branch October 9, 2025 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Android ANR: Session Replay Blocking Main Thread During onStop()
4 participants