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
All method are invoked by PathChildrenCacheListener.childEvent, which will be invoke by a single thread with event order. You can debug it or print a thread id to find that.
RegistryDataCache is not thread safe, yes, but it is used in a thread safe case.
Although it is written by one and read by others, it is better to be thread safe in my opinion. A better practice is using Map.compute or Map.computeIfAbsent rather than multi changes above.
The way we use ConcurrentHashMap may be not correct.
For example:
Sometimes
put()
method may be invoked twice, it is not we expected.The text was updated successfully, but these errors were encountered: