Details
-
Type:
Bug
-
Status: Gathering Impact (View Workflow)
-
Priority:
Medium
-
Resolution: Unresolved
-
Affects Version/s: 7.6.9, 7.13.8, 8.5.4
-
Fix Version/s: None
-
Component/s: User Management - Others
-
Introduced in Version:7.06
-
Support reference count:13
-
Symptom Severity:Severity 2 - Major
-
UIS:108
-
Bug Fix Policy:
Description
Issue Summary
Certain functionalities in Jira, such as trying to mention users or otherwise typing usernames into user fields, allow Jira to return user suggestions as usernames are being typed out.
As the searching user types, Jira will use a thread to perform a search against what they've typed and return possible results back to the user. In instances with many users, directories, or nested groups, these searches may be computationally expensive and may run for several seconds in order to return results.
It is possible for the searching user to continue typing and end up making multiple user search requests before the previous requests ever complete and return. Jira will not cancel or otherwise terminate previously ongoing search threads in this case.
The instance may experience high CPU load and thread utilization if too many of these threads are working on these searches concurrently.
Steps to Reproduce
- Have many users, groups/nested groups, and directories.
- Attempt to search for a user (i.e. by mentioning or perhaps trying to assign an issue), by typing a character out at a pace of 2-3 characters/second.
Expected Results
Suggested users will be returned, and no other behaviors (high CPU/thread usage) are observed.
Actual Results
Suggested users may be returned, but CPU and thread usage run high. Excessive usage may cause the system to become unresponsive.
Thread Dumps show many threads like the following, which showcase a user mention being searched against nested groups in this particular example:
"http-nio-8080-exec-20 url:/rest/internal/2/user/mention/search username:" #49 daemon prio=5 os_prio=0 tid=0x00007f8210b43000 nid=0x5d85 runnable [0x00007f810e1e1000] java.lang.Thread.State: RUNNABLE ... at com.atlassian.crowd.search.EntityDescriptor.toString(EntityDescriptor.java:103) at java.lang.String.valueOf(String.java:2994) at java.lang.StringBuilder.append(StringBuilder.java:131) at com.atlassian.crowd.search.query.membership.MembershipQuery.(MembershipQuery.java:60) at com.atlassian.crowd.search.query.membership.GroupMembershipQuery.(GroupMembershipQuery.java:19) at com.atlassian.crowd.search.builder.QueryBuilder.createMembershipQuery(QueryBuilder.java:177) at com.atlassian.crowd.search.builder.QueryBuilder$PartialMembershipQueryWithNameToMatch.returningAtMost(QueryBuilder.java:285) at com.atlassian.crowd.manager.directory.RemoteDirectorySearcher.findNestedGroupMembershipsIncludingGroups(RemoteDirectorySearcher.java:278) at com.atlassian.crowd.manager.directory.RemoteDirectorySearcher.findNestedGroupMembershipsOfUser(RemoteDirectorySearcher.java:300) at com.atlassian.crowd.manager.directory.RemoteDirectorySearcher.getParentDirectoryEntities(RemoteDirectorySearcher.java:203) at com.atlassian.crowd.manager.directory.RemoteDirectorySearcher.getRelatedDirectoryEntities(RemoteDirectorySearcher.java:191) at com.atlassian.crowd.manager.directory.RemoteDirectorySearcher.searchNestedGroupRelationships(RemoteDirectorySearcher.java:170) at com.atlassian.crowd.manager.directory.DirectoryManagerGeneric.searchNestedGroupRelationships(DirectoryManagerGeneric.java:750) at com.atlassian.crowd.manager.application.SingleDirectorySearchStrategy.searchNestedGroupRelationships(SingleDirectorySearchStrategy.java:71)
Access Logs show individual HTTP requests being made for each character typed:
/rest/api/latest/user/assignable/search?username=j /rest/api/latest/user/assignable/search?username=ji /rest/api/latest/user/assignable/search?username=jir /rest/api/latest/user/assignable/search?username=jira /rest/api/latest/user/assignable/search?username=jiraa
Workaround
Reducing the complexity and dataset of users, groups, nested groups, and directories may help reduce the calculation cost and time of these searches.
Suggested Solution
Allow administrators to configure the frequency at which the browser may submit search requests.
Attachments
Issue Links
- is related to
-
JSWSERVER-20272 JQL autocomplete suggestions on Epic field may cause performance issues
-
- Closed
-
-
JRASERVER-67502 RequestCachingGroupManager may accumulate too many objects in RequestCache during processing large user sets
-
- Closed
-
-
JSDSERVER-6808 Slowly typing query into JSD Project Workload search causes service unavailability
-
- Gathering Impact
-
- relates to
-
JRASERVER-70934 Requests to `/jira/rest/internal/2/user/mention/search` where the parameters do NOT include a query are very slow
-
- Gathering Impact
-