Skip to content

Make a copy of attributes before passing them to RUM event#1830

Merged
0xnm merged 1 commit into
developfrom
nogorodnikov/make-a-copy-of-attributes-before-passing-to-rum-event
Jan 22, 2024
Merged

Make a copy of attributes before passing them to RUM event#1830
0xnm merged 1 commit into
developfrom
nogorodnikov/make-a-copy-of-attributes-before-passing-to-rum-event

Conversation

@0xnm

@0xnm 0xnm commented Jan 18, 2024

Copy link
Copy Markdown
Member

What does this PR do?

This PR makes a copy of the attributes used by the different RUM events, because usually these attributes are stored in as the shared property of the RUM scope, they could be modified by the RUM thread while being read during the serialization on the I/O thread.

This will eventually prevent ConcurrentModificationException.

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 January 18, 2024 14:12

@mariusc83 mariusc83 left a comment

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.

Nice catch

@codecov-commenter

codecov-commenter commented Jan 18, 2024

Copy link
Copy Markdown

Codecov Report

Merging #1830 (2238f81) into develop (3d5e3d6) will increase coverage by 0.09%.
The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1830      +/-   ##
===========================================
+ Coverage    83.45%   83.54%   +0.09%     
===========================================
  Files          467      467              
  Lines        16484    16486       +2     
  Branches      2482     2483       +1     
===========================================
+ Hits         13756    13772      +16     
+ Misses        2040     2039       -1     
+ Partials       688      675      -13     
Files Coverage Δ
...ndroid/rum/internal/domain/scope/RumActionScope.kt 97.19% <100.00%> (+0.58%) ⬆️
...roid/rum/internal/domain/scope/RumResourceScope.kt 94.10% <100.00%> (-0.70%) ⬇️
.../android/rum/internal/domain/scope/RumViewScope.kt 93.94% <100.00%> (+0.78%) ⬆️

... and 19 files with indirect coverage changes

@0xnm
0xnm merged commit 8145782 into develop Jan 22, 2024
@0xnm
0xnm deleted the nogorodnikov/make-a-copy-of-attributes-before-passing-to-rum-event branch January 22, 2024 07:50
@xgouchet xgouchet added this to the 2.6.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.

5 participants