Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-4228

Licensed user count cache should be repopulated in the background to avoid blocking request threads

    XMLWordPrintable

Details

    Description

      getUsersWithPermission users UserService.findUsersByGroup to load the StashUsers for each group. It then calls getName() name on all of these users to get the usernames. Under the hood embedded crowd loads each user by name for the findUsersByGroup query if there are multiple directories and the user isn't in the first one. This can make getUsersWithPermission incredibly expensive (n+1 problem).

      The LicenseService attempts to mitigate this by caching the licensed user count. However it maintains 5 separate caches requiring the licensed user count to be repopulated for each. The cache should be consolidated and repopulated in the background to minimise the impact on end users.

      Workaround

      The current workaround is to reorder the directories to have the largest directory first. When doing this you should be mindful of STASH-3717 which can lead to users being locked out of Stash

      Attachments

        Issue Links

          Activity

            People

              jhinch jhinch (Atlassian)
              jhinch jhinch (Atlassian)
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: