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
When looking at the implementation of PropertyWrapper, I've seen two potential issues for consumers of this API:
PropertyWrapper wraps a DynamicProperty (which is thread safe), but appears to not be thread safe itself (specifically the callbackList field). It would be useful to document this (that addCallback and removeAllCallbacks should be synchronized) or perhaps switch the callbackList to a CopyOnWriteArrayList similar to DynamicProperty. Reference:
In removeAllCallbacks, the callback is removed from DynamicProperty but the entry in callbackList is not removed. This will lead to a resource leak over time as there doesn't appear to be a way to remove callbacks from callbackList. Reference:
When looking at the implementation of PropertyWrapper, I've seen two potential issues for consumers of this API:
PropertyWrapper
wraps aDynamicProperty
(which is thread safe), but appears to not be thread safe itself (specifically thecallbackList
field). It would be useful to document this (thataddCallback
andremoveAllCallbacks
should be synchronized) or perhaps switch thecallbackList
to aCopyOnWriteArrayList
similar toDynamicProperty
. Reference:archaius/archaius-core/src/main/java/com/netflix/config/PropertyWrapper.java
Line 41 in e623c01
removeAllCallbacks
, the callback is removed fromDynamicProperty
but the entry incallbackList
is not removed. This will lead to a resource leak over time as there doesn't appear to be a way to remove callbacks fromcallbackList
. Reference:archaius/archaius-core/src/main/java/com/netflix/config/PropertyWrapper.java
Lines 156 to 164 in e623c01
I can raise a PR to resolve these issues.
The text was updated successfully, but these errors were encountered: