You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[9.1](backport #46018) Remove all remaining NewRegistry method calls (#46222)
* Remove all remaining NewRegistry method calls (#46018)
The `NewRegistry` method in `elastic-agent-libs` is inherently unsafe, especially in concurrent code: calling `NewRegistry` on a name that already exists causes a panic, but checking whether the name exists first is not atomic. The recently added `GetOrCreateRegistry` method is a safe alternative that checks the name's existence and initializes it atomically, and never panics. This PR replaces all remaining `NewRegistry` calls with `GetOrCreateRegistry`.
(cherry picked from commit bf7a774)
# Conflicts:
# libbeat/monitoring/inputmon/input_test.go
* fix merge
---------
Co-authored-by: Fae Charlton <[email protected]>
0 commit comments