-
-
Notifications
You must be signed in to change notification settings - Fork 357
fix(android): Fix ConcurrentModificationException #5588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
antonis
wants to merge
2
commits into
antonis/capture-app-start-errors-v8
Choose a base branch
from
antonis/capture-app-start-android-loop
base: antonis/capture-app-start-errors-v8
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
fix(android): Fix ConcurrentModificationException #5588
antonis
wants to merge
2
commits into
antonis/capture-app-start-errors-v8
from
antonis/capture-app-start-android-loop
+44
−10
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ve crash handling When enableNativeCrashHandling is set to false, the code was iterating over the integrations list with a for-each loop while calling remove() directly, which causes a ConcurrentModificationException at runtime. Fixed by using Java 8's removeIf() method which safely handles iteration and removal in a single operation. This is more concise and follows modern Java best practices. Added unit tests to verify the fix and ensure integrations are properly removed without throwing exceptions. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
Semver Impact of This PR⚪ None (no version bump detected) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
10 tasks
Contributor
Author
|
@sentry review |
Contributor
Android (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 405.80 ms | 412.56 ms | 6.77 ms |
| 88812b1+dirty | 428.04 ms | 462.22 ms | 34.18 ms |
| 82de722+dirty | 425.13 ms | 457.02 ms | 31.89 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 43.75 MiB | 48.40 MiB | 4.65 MiB |
| 88812b1+dirty | 43.75 MiB | 48.40 MiB | 4.64 MiB |
| 82de722+dirty | 43.75 MiB | 48.40 MiB | 4.64 MiB |
Contributor
Android (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 364.57 ms | 389.29 ms | 24.71 ms |
| 88812b1+dirty | 425.90 ms | 435.25 ms | 9.35 ms |
| 82de722+dirty | 398.52 ms | 422.70 ms | 24.18 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| b4df5a0+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
| 88812b1+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
| 82de722+dirty | 43.94 MiB | 49.22 MiB | 5.29 MiB |
Contributor
iOS (new) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 1210.98 ms | 1215.22 ms | 4.24 ms |
| 82de722+dirty | 1210.87 ms | 1217.00 ms | 6.13 ms |
| b4df5a0+dirty | 1217.06 ms | 1221.61 ms | 4.55 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| 82de722+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| b4df5a0+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
Contributor
iOS (legacy) Performance metrics 🚀
|
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 1216.63 ms | 1215.55 ms | -1.08 ms |
| 82de722+dirty | 1213.09 ms | 1208.90 ms | -4.19 ms |
| b4df5a0+dirty | 1213.04 ms | 1218.59 ms | 5.55 ms |
App size
| Revision | Plain | With Sentry | Diff |
|---|---|---|---|
| 88812b1+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| 82de722+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
| b4df5a0+dirty | 3.38 MiB | 4.67 MiB | 1.29 MiB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on #5582
📢 Type of change
📜 Description
Fix ConcurrentModificationException when disabling native crash handling
When enableNativeCrashHandling is set to false, the code was iterating over the integrations list with a for-each loop while calling remove() directly, which causes a ConcurrentModificationException at runtime.
Fixed by using Java 8's removeIf() method which safely handles iteration and removal in a single operation. This is more concise and follows modern Java best practices.
Added unit tests to verify the fix and ensure integrations are properly removed without throwing exceptions.
💡 Motivation and Context
See #5582 (comment)
💚 How did you test it?
CI, Manually
📝 Checklist
sendDefaultPIIis enabled🔮 Next steps
#skip-changelog