optimizely/android-sdk

ConcurrentModificationException in NotificationManager.addHandler()

se01832 opened this issue · 3 comments

We've seen about ~75 crashes in the last 3 months due to a ConcurrentModificationException when calling NotificationCenter.addNotificationHandler().

Stack trace:

Fatal Exception: java.util.ConcurrentModificationException
       at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:757)
       at java.util.LinkedHashMap$LinkedValueIterator.next(LinkedHashMap.java:785)
       at com.optimizely.ab.notification.NotificationManager.addHandler(NotificationManager.java:50)
       at com.optimizely.ab.notification.NotificationCenter.addNotificationHandler(NotificationCenter.java:119)

This issue looks very similar to one reported previously, where the mutable map is being altered on a background thread: #227

@se01832 Thanks for sharing. We'll look into it.

@se01832 We released android-sdk 3.13.1 patch which includes the fix for this issue.

@jaeopt Thank you! We'll include the fix in our next release and let y'all know if we see the issue again!