Details
-
Bug
-
Resolution: Fixed
-
Major
-
10.8-rc-1
-
Unit
-
Unknown
-
N/A
-
N/A
-
Description
Steps to reproduce:
Difficult. We observed this on an XWiki instance with a big user group (5k users) where the members of this group are queried in three different places in the skin. When the group is updated, we saw slow traces in Glowroot that indicated that the GroupManager waited several times for the group to be loaded into the cache. It is possible that this can only be observed under high load.
Expected result:
The group is only loaded once into the cache, and all threads requesting groups wait for that load.
Actual result:
The group is loaded by several, different threads. This is because there is a race condition in the groups cache, it checks first if the group is in the cache under a read lock, and then acquires a write lock to add the group to the cache. However, under the write lock, it doesn't check again if the group is already in the cache.