adutra opened a new pull request, #3755: URL: https://github.com/apache/polaris/pull/3755
The `ALL_CONFIGURATIONS` field is using `ArrayList` which is not thread-safe. The field is only accessed via `registerConfiguration()`, and all configurations are currently registered during static initialization. But we have two subclasses, `FeatureConfiguration` and `BehaviorChangeConfiguration`, that both call that method. Consider this scenario: 1. Thread A triggers loading of `FeatureConfiguration`; 2. Thread B triggers loading of `BehaviorChangeConfiguration`; 3. Both classes' static initializers run in parallel; 4. Both call `registerConfiguration()` on the shared list concurrently. In order to avoid this, this PR changes the list to `CopyOnWriteArrayList`. <!-- ๐ Describe what changes you're proposing, especially breaking or user-facing changes. ๐ See https://github.com/apache/polaris/blob/main/CONTRIBUTING.md for more. --> ## Checklist - [ ] ๐ก๏ธ Don't disclose security issues! (contact [email protected]) - [ ] ๐ Clearly explained why the changes are needed, or linked related issues: Fixes # - [ ] ๐งช Added/updated tests with good coverage, or manually tested (and explained how) - [ ] ๐ก Added comments for complex logic - [ ] ๐งพ Updated `CHANGELOG.md` (if needed) - [ ] ๐ Updated documentation in `site/content/in-dev/unreleased` (if needed) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
