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

The Calendar Gadget can cause high CPU and memory usage for large filters

XMLWordPrintable

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Symptom

      CPU Usage high and potentially running into outofmemory error.

      When generating thread dump, below stack is found:

      "TP-Processor2" daemon prio=10 tid=0x4b897000 nid=0x46a3 runnable [0x4d48b000]
         java.lang.Thread.State: RUNNABLE
      	at java.util.ResourceBundle.getClassContext(Native Method)
      	at java.util.ResourceBundle.getLoader(ResourceBundle.java:400)
      	at java.util.ResourceBundle.getBundle(ResourceBundle.java:822)
      	at sun.util.resources.LocaleData$1.run(LocaleData.java:127)
      	at java.security.AccessController.doPrivileged(Native Method)
      	at sun.util.resources.LocaleData.getBundle(LocaleData.java:125)
      	at sun.util.resources.LocaleData.getDateFormatData(LocaleData.java:113)
      	at java.text.DateFormatSymbols.cacheLookup(DateFormatSymbols.java:578)
      	at java.text.DateFormatSymbols.initializeData(DateFormatSymbols.java:587)
      	at java.text.DateFormatSymbols. (DateFormatSymbols.java:123)
      	at java.text.DateFormatSymbols.getInstance(DateFormatSymbols.java:297)
      	at java.text.SimpleDateFormat. (SimpleDateFormat.java:499)
      	at java.text.SimpleDateFormat. (SimpleDateFormat.java:476)
      	at net.fortuna.ical4j.model.Iso8601. (Iso8601.java:63)
      	at net.fortuna.ical4j.model.Time. (Time.java:74)
      	at net.fortuna.ical4j.model.DateTime. (DateTime.java:110)
      	at com.atlassian.jira.ext.calendar.model.DateFieldProvider.getDate(DateFieldProvider.java:126)
      	at com.atlassian.jira.ext.calendar.model.IssueComparator.compare(IssueComparator.java:28)
      	at com.atlassian.jira.ext.calendar.model.IssueComparator.compare(IssueComparator.java:9)
      

      Scanning the access logs which being served more than 60 seconds, potentially showing the call for the Calender:

      awk '{ if ($11 > 60000000) print $0; }' /path/to/access_log
      
      131.103.26.162 111.93.251.138 - [23/Nov/2014:07:10:54 +0530] "GET /rest/calendar-plugin/1.0/calendar/htmlcalendar.html?dateFieldName=customfield_10201&displayVersions=false&numOfIssueIcons=10&context=gadget&portletId=10286&includeContainer=true&searchRequestId=10157&_=1416706853400 HTTP/1.0" 200 49104 104464109 "<instance name>/plugins/servlet/gadgets/ifr?container=atlassian&mid=10286&country=US&lang=en&view=default&view-params=%7B%22writable%22%3A%22false%22%7D&st=atlassian%3AYasv4X6Y%2BcC2C2r2ihAQukEYqqp6x8QJ65Rk5GQUxM6pDjgF8FjgQVgGehSkmSzGieCE19cHKm%2FLsanNHGOy2BV7LrS2JJ%2BcRyC%2FUrOOI%2BvzG1K9OeLZb0Hcc5ejYeQSCMN7qVYKzu0R6qZelv0nP%2F5ruFAxc3J9lXaSuFcI1WsujoWYgBIVE2HzOkQWm0fIEBpjuTjFcmWvp%2B8Uos0S%2F%2FtNjyWAh1BXTJB6D3Y9KqJKBkJLKXgHO0gB6FZBSkK4k635F%2FUKLx0s5VrJfh8Hl3gdG1Cqcx6MwzlGO4O%2F1Km4zgU5%2B28nUBimuLPdlJdEGPxSLwztoDzuR5351pjqPUsvT1Sog8Z7m7%2BdTXgom5CYCJM2donoowZH9r3n7z4ycc5iQbtWM1FLVWtyiP0rcsYWWA0Q3HEMoeyNO094H7o1U%2BaFgNPfT8eckCqToBrHHulqSw%3D%3D&up_isConfigured=true&up_projectOrFilterId=filter-10157&up_dateFieldName=customfield_10201&up_displayVersions=false&up_numOfIssueIcons=10&up_refresh=15&url=https%3A%2F%2F<instance name>t%2Frest%2Fgadgets%2F1.0%2Fg%2Fcom.atlassian.jira.ext.calendar%3Aissuescalendar-gadget%2Ftemplates%2Fplugins%2Fjira%2Fportlets%2Fcalendar%2Fgadget%2Fcalendar-gadget.xml&libs=auth-refresh" "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0"
      

      Cause:

      The Calender Gadget retrieving all the issues and attempts to compare the date to render the result.

      Tested using a vanilla instance, generated 30k issues with 30k custom field (date time) and added a Calender to show. It spikes the CPU usage and took more than 5 seconds to complete rendering the data. Imagine the impact for a busy instances, a bad combination could result on constant GC and CPU consistently high.

      Workaround

      To down size the filter by adding the created date clause to reduce the number returned. Or remove the gadget to check if this is the primary cause of the issue.

            Unassigned Unassigned
            rgee Richie Gee (Inactive)
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: