Uploaded image for project: 'Advanced Roadmaps'
  1. Advanced Roadmaps
  2. JPOSERVER-2307

Filters yielding large issue result set can cause out-of-memory exception

This issue belongs to an archived project. You can view it, but you can't modify it. Learn more

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Low Low
    • 2.13.0
    • 2.5.0, 2.12.1
    • Plan

      Summary

      When a plan is created that is based on a JQL query that does not contain any project ids and yields a very large number of issues it is possible to cause an out-of-memory exception.

      This is because the getProjectIdsViaExhaustiveSearch function attempts to determine the project IDs by running the JQL query and then iterating over the results to find the set of projects in the plan. However, the search is performed without any limit on the number of results and this means that if there are a lot of results then memory can be exhausted during the processing.

      Environment

      • Large instance with > 1M issues

      Steps to Reproduce

      1. generate 1M issues
      2. create Portfolio Plan with empty board filter
      3. load this board repeatedly

      Expected Results

      • there should be a limit of issues can be loaded in a single board
      • there should be a validation check for creating board with empty filter

      Actual Results

      Jira consumes large heap and eventually OOME

      Notes

      Suggested resolution is to have to page over all the results (with the page size being that of the issue limit) to ensure that issues are processed in manageable chunks.

      Workaround

      Retrieve the empty JQL plans using the following SQL query

      select "p"."TITLE", "is"."SOURCE_TYPE", "is"."SOURCE_VALUE","rv"."SAVED_FILTER_ID", sr.reqcontent 
      from "AO_D9132D_ISSUE_SOURCE" "is" full 
      join "AO_60DB71_RAPIDVIEW" "rv" on cast("is"."SOURCE_VALUE" as int) = "rv"."ID" 
      join searchrequest sr on (sr.id = "rv"."SAVED_FILTER_ID" or sr.id = cast("is"."SOURCE_VALUE" as int))
      join "AO_D9132D_PLAN" "p" on "p"."ID" = "is"."PLAN_ID"
      where sr.reqcontent = '' OR sr.reqcontent IS NULL;
      

      Once identified, reach out to the respective user to update the JQL query.

              ddraper@atlassian.com Dave
              ddraper@atlassian.com Dave
              Archiver:
              atibrewal@atlassian.com Aakrity Tibrewal

                Created:
                Updated:
                Resolved:
                Archived: