Skip to content

RUM-2467: Fix ConcurrentModificationException during ConsentAwareStorage.dropAll call#1764

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/rum-2467/fix-concurrentmodificationexception-in-dropall-call
Dec 15, 2023
Merged

RUM-2467: Fix ConcurrentModificationException during ConsentAwareStorage.dropAll call#1764
0xnm merged 1 commit into
developfrom
nogorodnikov/rum-2467/fix-concurrentmodificationexception-in-dropall-call

Conversation

@0xnm

@0xnm 0xnm commented Dec 14, 2023

Copy link
Copy Markdown
Member

What does this PR do?

We were removing items from collection during its traversal, this PR fixes that.

The issue doesn't reproduce with only single item in the collection, because modification check it done on the next iteration, so I also updated test to have multiple locked batches.

Review checklist (to be filled by reviewers)

  • Feature or bugfix MUST have appropriate tests (unit, integration, e2e)
  • Make sure you discussed the feature or bugfix with the maintaining team in an Issue
  • Make sure each commit and the PR mention the Issue number (cf the CONTRIBUTING doc)

@0xnm
0xnm requested review from a team as code owners December 14, 2023 10:47
deleteBatch(it, RemovalReason.Flushed)
lockedBatches.remove(it)
}
lockedBatches.clear()

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

@codecov-commenter

codecov-commenter commented Dec 15, 2023

Copy link
Copy Markdown

Codecov Report

Merging #1764 (c4595d6) into develop (b628685) will increase coverage by 0.05%.
Report is 2 commits behind head on develop.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1764      +/-   ##
===========================================
+ Coverage    83.43%   83.48%   +0.05%     
===========================================
  Files          469      469              
  Lines        16394    16391       -3     
  Branches      2448     2447       -1     
===========================================
+ Hits         13678    13683       +5     
+ Misses        2048     2039       -9     
- Partials       668      669       +1     
Files Coverage Δ
...d/core/internal/persistence/ConsentAwareStorage.kt 98.78% <100.00%> (ø)

... and 23 files with indirect coverage changes

@0xnm
0xnm merged commit 2270a11 into develop Dec 15, 2023
@0xnm
0xnm deleted the nogorodnikov/rum-2467/fix-concurrentmodificationexception-in-dropall-call branch December 15, 2023 12:52
@xgouchet xgouchet added this to the 2.4.0 milestone Feb 19, 2024
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.

4 participants