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

Large filter subscriptions can crash a JIRA instance with an OutOfMemoryError

    XMLWordPrintable

Details

    Description

      Summary

      JIRA has no 'rate limiting' or mail limit on filter subscriptions. This means using certain configurations will allow for a significant amount of mail to be created. As this mail is persisted in memory, it's possible to cause OutOfMemoryError's, even with a significant amount of heap space.

      Steps to Reproduce

      1. Use an instance with a large amount of issues and users, using test mail addresses.
      2. Enable mail notifications.
      3. Setup a filter subscription that will notify all users (for example sends to jira-users), using JQL as below:
        updated < "-200m"
        
      4. Set a high frequency on the updates as per the screenshot.

      Expected Results

      Some form of rate limiting, or logic is used such that the instance does not result in consuming all of the available heap space and crashing with an OutOfMemoryError.

      Actual Results

      An OutOfMemoryError is thrown as the heap space fills up with mails.

      Workaround

      Avoid using filter subscriptions with large recipient bases that use a filter that returns a large amount of issues.
      SQLs to check that:

      // Check subscription
      select * from filtersubscription;
      
      // check JQL for subscription
      select s.id, s.reqcontent, s.filtername, s.authorname, fs.groupname from filtersubscription fs 
      join searchrequest s ON fs.filter_i_d = s.id;
      
      // Check large groups subscription
      select * from filtersubscription where groupname in (select parent_name from cwd_membership where membership_type = 'GROUP_USER' group by parent_name, directory_id having count(1) > 100);
      

      Attachments

        1. array of mail items - item detail.png
          array of mail items - item detail.png
          184 kB
        2. High Frequency.jpg
          High Frequency.jpg
          114 kB
        3. huge object.png
          huge object.png
          95 kB
        4. Subscribe.jpg
          Subscribe.jpg
          131 kB

        Issue Links

          Activity

            People

              izinoviev Ilya Zinoviev (Inactive)
              jforsythe joe
              Votes:
              7 Vote for this issue
              Watchers:
              13 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: