Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-19230

REST call lastVisited executes board-scope-filter which leads to performance overhead

XMLWordPrintable

      Summary

      REST API call PUT /rest/projects/1.0/project/<PRJ>/lastVisited is used to track last visited project.
      While executing the call, method started to load the context thus executing com.atlassian.greenhopper.web.sidebar.BoardScopeFilterContextProviderImpl#getContext which leads to expensive computations (see JSWSERVER-16185).
      Due to excessive computation, it puts extra pressure for the permission cache and increases CPU usage, which may lead to degraded performance of the whole Jira instance.

      Steps to Reproduce

      1. Load any issue, Jira will execute PUT /rest/projects/1.0/project/<PRJ>/lastVisited as part of page loading
      2. Put a break point and collect stack-trace

      Expected Results

      getContext is not executed

      Actual Results

      getContext is executed

      Notes

      Taking into account that /lastVisited is executed for each issue load, this adds extra CPU overhead for Jira.
      Snippet from stacktrace:

      ...
      	at com.atlassian.greenhopper.service.query.QueryServiceImpl.getProjectsForRapidView(QueryServiceImpl.java:137)
      	at com.atlassian.greenhopper.service.query.QueryServiceImpl.getExplicitProjectsForRapidViewFilterQuery(QueryServiceImpl.java:128)
      	at com.atlassian.greenhopper.service.rapid.ProjectRapidViewServiceImpl.findProjectsByRapidView(ProjectRapidViewServiceImpl.java:69)
      	at com.atlassian.greenhopper.service.rapid.ProjectRapidViewServiceImpl.findRapidViewsByProject(ProjectRapidViewServiceImpl.java:51)
      	at com.atlassian.greenhopper.web.sidebar.ProjectBoardsHelper.getProjectBoards(ProjectBoardsHelper.java:53)
      	at com.atlassian.greenhopper.web.sidebar.BoardScopeFilterContextProviderImpl.getContext(BoardScopeFilterContextProviderImpl.java:47)
      	at com.atlassian.jira.projects.context.ProjectContextPopulatorImpl.populateWithProject(ProjectContextPopulatorImpl.java:82)
      	at com.atlassian.jira.projects.sidebar.navigation.SidebarNavigationService.getNavigationItemById(SidebarNavigationService.java:49)
      	at com.atlassian.jira.projects.sidebar.lastvisited.LastVisitedNavigationItemHelper.getNavigationItemById(LastVisitedNavigationItemHelper.java:58)
      	at com.atlassian.jira.projects.sidebar.lastvisited.LastVisitedItemInProjectService.isValid(LastVisitedItemInProjectService.java:101)
      	at com.atlassian.jira.projects.sidebar.lastvisited.LastVisitedItemInProjectService.setLastVisitedItemIdForProject(LastVisitedItemInProjectService.java:59)
      	at com.atlassian.jira.projects.sidebar.lastvisited.LastVisitedItemResource.updateLastVisitedItem(LastVisitedItemResource.java:51)
      ...
      

      Based on performance data, /lastVisited calls might be up to 10% of all CPU active threads.

      Workaround

      Please check JSWSERVER-16717 to be able to disable sidebar loading code.

              gtanczyk Grzegorz Tanczyk (Inactive)
              ayakovlev@atlassian.com Andriy Yakovlev [Atlassian]
              Votes:
              1 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated:
                Resolved: