Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-59020

slow execution of create project dialog

    XMLWordPrintable

Details

    Description

      Summary

      Modal loads slowly when creating a project and returns an error message as seen below

      Environment

      • JIRA configured with multiple LDAP connectors and/or high amount of users in application

      Steps to Reproduce

      1. Connect JIRA to one or more LDAP directories which syncs a large amount of users

      Expected Results

      • Faster load on create project modal

      Actual Results

      A large amount of time is spent fetching users. This can be seen from profiling application here:

      Workaround

      • There is a 5 second timeout on the create project dialog in JIRA 7.0.0, 7.0.1 and 7.02 which exasperates this problem. In JIRA 7.0.4 the timeout has been increased to 60 seconds. Upgrading to a JIRA version later than 7.0.3 should help.

      Original Description:

      In certain situations (a lot of external user directories) create project dialog can timeout due to slow backend processing.
      In my case client had like 17 AD configured and during the create project dialog there is some code executed:
      com.atlassian.jira.projecttemplates.rest.ProjectTemplatesResource#getProjectTemplates

      ...
                      .shouldShowProjectLead(userManager.getTotalUserCount() > 1 || !authContext.isLoggedInUser())
      ...
      

      the offending line is:

      userManager.getTotalUserCount() > 1
      

      which basically means that we want to display project lead picker (user picker).
      The current implementation iterates over all directories and handles shadow users and it's slow. but in this case we need only information if there are multiple users in the system (more than 1).
      maybe instead of

      userManager.getTotalUserCount()

      we could use something like

      com.atlassian.jira.bc.user.search.DefaultUserPickerSearchService#findUsers(com.atlassian.jira.bc.JiraServiceContext, java.lang.String, com.atlassian.jira.bc.user.search.UserSearchParams)
      

      and pass parameter that limits output to 2 users (or any other way of doing some fast query with user limit)

      Attachments

        1. getProjectTemplates.png
          getProjectTemplates.png
          130 kB
        2. timeout.png
          timeout.png
          17 kB

        Issue Links

          Activity

            People

              prunge Peter Runge (Inactive)
              tkanafa Tomasz Kanafa
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: