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
ContainerCache uses TreeMap which is not thread-safe.
We ran into an issue in production with calls to Account.getContainer from multiple threads. This method delegates to ContainerCache.getContainer which looks up the container by name from the internal TreeMap data structure. If there is a cache miss, it creates a new Container and puts it in the TreeMap. So you can get multiple threads concurrently accessing and modifying the TreeMap which in combination with tree rebalancing can result in some bad race conditions. We saw our threads spinning in the call to retrieve a container from the TreeMap. The solution for us was to use our own caching and disable the cache in ContainerCache. However this issue needs a permanent fix.
The text was updated successfully, but these errors were encountered:
ContainerCache uses TreeMap which is not thread-safe.
We ran into an issue in production with calls to Account.getContainer from multiple threads. This method delegates to ContainerCache.getContainer which looks up the container by name from the internal TreeMap data structure. If there is a cache miss, it creates a new Container and puts it in the TreeMap. So you can get multiple threads concurrently accessing and modifying the TreeMap which in combination with tree rebalancing can result in some bad race conditions. We saw our threads spinning in the call to retrieve a container from the TreeMap. The solution for us was to use our own caching and disable the cache in ContainerCache. However this issue needs a permanent fix.
The text was updated successfully, but these errors were encountered: