Skip to content
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

Prevent potential ConcurrentModificationException when adding callback #149

Merged
merged 3 commits into from
Aug 14, 2019

Conversation

fractalwrench
Copy link
Contributor

Goal

If a callback is added while existing callbacks are being iterated through, bugsnag will crash. This
changeset addresses this issue by using a ConcurrentLinkedQueue which retains the callback order,
but will not crash if new callbacks are added concurrently. This fix has been ported from
bugsnag/bugsnag-android#266

Tests

Added a unit test for regression testing, otherwise relied on existing coverage.

If a callback is added while existing callbacks are being iterated through, bugsnag will crash. This
changeset addresses this issue by using a ConcurrentLinkedQueue which retains the callback order,
but will not crash if new callbacks are added concurrently. This fix has been ported from
bugsnag/bugsnag-android#266
@fractalwrench fractalwrench changed the title fix: prevent ConcurrentModificationException when adding callback Prevent potential ConcurrentModificationException when adding callback Aug 13, 2019
@fractalwrench fractalwrench merged commit 6fcb3f0 into master Aug 14, 2019
@fractalwrench fractalwrench deleted the fix-concurrent-modification-exc branch August 14, 2019 15:44
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.

2 participants