| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. Bug Fixes 🐛
Internal Changes 🔧
🤖 This preview updates automatically when you update the PR. |
Sorry, something went wrong.
Instructions and example for changelogPlease add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number. Example: ## Unreleased
### Fixes
- Reset shouldStop flag on startProfiler ([#5284](https://github.com/getsentry/sentry-java/pull/5284))If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label. |
Sorry, something went wrong.
📲 Install BuildsAndroid
|
Sorry, something went wrong.
Performance metrics 🚀
Baseline results on branch: mainStartup times
App size
Previous results on branch: fix/profiling-shouldstop-resetStartup times
App size
|
Sorry, something went wrong.
…artProfiler Same fix as PerfettoContinuousProfiler — shouldStop was never reset to false after stopProfiler, so a stop/start cycle would leave shouldStop=true and silently stop the profiler after one chunk. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
nice catch! please, add a changelog entry as well
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
📜 Description
shouldStop is never reset to false after stopProfiler(), so a stop/start cycle leaves shouldStop=true. When the next 60-second chunk timer fires, stop(restartProfiler=true) checks !shouldStop and does not restart — the profiler silently stops after one chunk instead of continuing indefinitely.
This affects both lifecycle modes:
Fix: reset shouldStop = false at the top of startProfiler(), since it represents a new intent to profile.
💡 Motivation and Context
Discovered while working on the Perfetto ProfilingManager integration (#5251). The same bug existed in both AndroidContinuousProfiler and PerfettoContinuousProfiler.
💚 How did you test it?
Unit test added: manual profiler can be started again after a full start-stop cycle — starts profiling, stops it, starts again, verifies the profiler continues running after the first chunk restart.
📝 Checklist
🔮 Next steps
None — standalone bugfix.