DataDog / dd-sdk-android

Datadog SDK for Android (Compatible with Kotlin and Java)
Apache License 2.0
146 stars 59 forks source link

RUM-5447 Fix the racing condition in the RotatingDnsResolver logic #2127

Closed mariusc83 closed 1 month ago

mariusc83 commented 1 month ago

What does this PR do?

In this PR we are fixing the race condition problem that was caused by a concurrent access to an unprotected list in the RotatingDnsResolver class. This was raised by the Support team in this ticket: https://datadog.zendesk.com/agent/tickets/1761693

Motivation

What inspired you to submit this pull request?

Additional Notes

Anything else we should know when reviewing?

Review checklist (to be filled by reviewers)

codecov-commenter commented 1 month ago

Codecov Report

Attention: Patch coverage is 87.50000% with 1 line in your changes missing coverage. Please review.

Project coverage is 70.02%. Comparing base (fc53808) to head (3967404). Report is 3 commits behind head on develop.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #2127 +/- ## =========================================== - Coverage 70.03% 70.02% -0.01% =========================================== Files 721 721 Lines 26773 26785 +12 Branches 4499 4501 +2 =========================================== + Hits 18749 18754 +5 - Misses 6771 6779 +8 + Partials 1253 1252 -1 ``` | [Files](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2127?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog) | Coverage Δ | | |---|---|---| | [...d/core/internal/data/upload/RotatingDnsResolver.kt](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2127?src=pr&el=tree&filepath=dd-sdk-android-core%2Fsrc%2Fmain%2Fkotlin%2Fcom%2Fdatadog%2Fandroid%2Fcore%2Finternal%2Fdata%2Fupload%2FRotatingDnsResolver.kt&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog#diff-ZGQtc2RrLWFuZHJvaWQtY29yZS9zcmMvbWFpbi9rb3RsaW4vY29tL2RhdGFkb2cvYW5kcm9pZC9jb3JlL2ludGVybmFsL2RhdGEvdXBsb2FkL1JvdGF0aW5nRG5zUmVzb2x2ZXIua3Q=) | `95.83% <87.50%> (+0.60%)` | :arrow_up: | ... and [28 files with indirect coverage changes](https://app.codecov.io/gh/DataDog/dd-sdk-android/pull/2127/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=DataDog)
datadog-datadog-staging-us1-all[bot] commented 1 month ago

Code Vulnerabilities

Error badge  Notice badge

Code Quality Violations

Error badge  Warning badge  Notice badge