Skip to content

[BUG] ConcurrentModificationException thrown while calling the decide function #507

Open
@marctatham

Description

@marctatham

Is there an existing issue for this?

  • I have searched the existing issues

SDK Version

5.0.0

Current Behavior

Crash in the optimizely SDK:

Stack trace:

          Caused by java.util.ConcurrentModificationException:
       at java.util.HashMap$HashIterator.nextNode(HashMap.java:1603)
       at java.util.HashMap$EntryIterator.next(HashMap.java:1636)
       at java.util.HashMap$EntryIterator.next(HashMap.java:1634)
       at java.util.HashMap.putMapEntries(HashMap.java:518)
       at java.util.HashMap.<init>(HashMap.java:491)
       at com.optimizely.ab.OptimizelyUserContext.<init>(OptimizelyUserContext.java:72)
       at com.optimizely.ab.OptimizelyUserContext.copy(OptimizelyUserContext.java:106)
       at com.optimizely.ab.OptimizelyUserContext.decide(OptimizelyUserContext.java:143)
       at com.optimizely.ab.OptimizelyUserContext.decide(OptimizelyUserContext.java:153)

Device breakdown:

Image

Data insights:

Image

Expected Behavior

No crash.

Steps To Reproduce

We have been unable to deterministically reproduce this issue.
This is affecting a small percentage of our user base, around 3%

Link

No response

Logs

Nothing relevant outside of the stacktrace already shared

Severity

Affecting users

Workaround/Solution

As this is a side-effect of calling the userContext.decide() There is no workaround that still results in the user receiving a valid decision.

Recent Change

No response

Conflicts

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions