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

Throwing UserNotFoundException results in performance degradation for large instances

    XMLWordPrintable

Details

    Description

      Summary

      When JIRA attempts to locate a user, it's possible that a UserNotFoundException may be thrown if the user does not exist. This can happen when:

      • There are multiple user directories.
      • The user exists in a directory lower down the list.
      • When JIRA attempts to locate the user, it will throw that exception for the directories the user does not exist in.

      The behaviour of this before it was fixed was:

      • A user goes to perform an operation in JIRA, such as fetching the projects they can access.
      • JIRA verifies the groups they need to be in to establish permission checks.
      • And then iterates through the user directories, attempting to find the user in each directory until it can.
      • It will throw a UserNotFoundException if that user is not found and the loop through the user directories continues.
      • This will occur on every action that attempts to find users, so a significant amount of the exceptions can be thrown.

      Steps to Reproduce

      1. Add multiple user directories.
      2. Place users in the bottom directory, that do not exist in the upper directories.

      Expected Results

      JIRA operates without any problems.

      Actual Results

      The UserNotFoundException is thrown a significant amount of times, resulting in performance problems.

      Workaround

      Alter the directory order so the users directories with the vast majority of users come higher in the list, in the order of the largest to smallest. This won't necessary fix the problem, rather reduce the overall impact of it as the user directory with the smaller amount of users will still need to be accessed.

      Having more directories will increase the performance impact of this issue.

      Notes

      Crowd's UserNotFoundException is causing performance degradation in hi load of requests and profiling the application.

      We should override the fillInStackTrace() method that calculates the stacktrace and just return it like this:

      
      @Override
          public synchronized Throwable fillInStackTrace()
          {
              return this;
          }
      
      

      We should also apply this to GroupNotFoundException

      Attachments

        Issue Links

          Activity

            People

              ohernandez@atlassian.com Oswaldo Hernandez (Inactive)
              ckhatchikian Carlos Khatchikian
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: