Uploaded image for project: 'Confluence Server'
  1. Confluence Server
  2. CONFSERVER-55887

Updating Event causes duplicated invitee in database and java.lang.OutOfMemoryError

    XMLWordPrintable

    Details

      Description

      Summary

      When updating an event which has invitee, it will cause duplication on invitee in the database. If we still keep updating that event, it will cause OOME on Confluence when viewing the Calendar.

      Environment

      • Version 5.5.0 of TC and above

      Diagnosis

      This SQL query will return the duplicates

      PostgreSQL
      select "EVENT_ID", "INVITEE_ID", count(*) from "AO_950DC3_TC_EVENTS_INVITEES" group by "EVENT_ID", "INVITEE_ID";
      
      MySQL
      select EVENT_ID, INVITEE_ID, count(*) from AO_950DC3_TC_EVENTS_INVITEES group by EVENT_ID, INVITEE_ID;
      

      Steps to Reproduce

      1. Create a calendar and an event
      2. Add one user to the event
      3. Add several more users to the event
      4. Delete the users

      Expected Results

      There will be only one entry for each user in AO_950DC3_TC_EVENTS_INVITEES.

      Actual Results

      There are duplicates in AO_950DC3_TC_EVENTS_INVITEES. This will lead to java.lang.OutOfMemoryError.

      2018-06-06 16:07:08,425 ERROR [http-nio-8090-exec-2] [common.error.jersey.ThrowableExceptionMapper] toResponse Uncaught exception thrown by REST service: Java heap space
       -- referer: https://confluence.mycompany.com/ | url: /rest/calendar-services/1.0/calendar/events.json | traceId: cb4b89b5605bbaf1 | userName: admin
      java.lang.OutOfMemoryError: Java heap space
      	at java.util.Arrays.copyOf(Arrays.java:3332)
      	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
      	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
      	at java.lang.StringBuffer.append(StringBuffer.java:270)
      	at net.fortuna.ical4j.model.component.VEvent.toString(VEvent.java:325)
      	at com.atlassian.confluence.extra.calendar3.DefaultCalendarManager.toSubCalendarEvent(DefaultCalendarManager.java:851)
      	at com.atlassian.confluence.extra.calendar3.ical4j.RecurrenceRuleProcessor.getRecurrenceEvents(RecurrenceRuleProcessor.java:115)
      	at com.atlassian.confluence.extra.calendar3.DefaultCalendarManager.getEvents(DefaultCalendarManager.java:715)
      

      Notes

      Heap Dump analysis shows one thread with most memory

      Workaround

      Upgrade TC.

        Attachments

        1. dominator_tree-1.png
          dominator_tree-1.png
          27 kB
        2. heapdump-1.png
          heapdump-1.png
          17 kB

          Issue Links

            Activity

              People

              Assignee:
              dluong Duy Truong Luong
              Reporter:
              dluong Duy Truong Luong
              Votes:
              2 Vote for this issue
              Watchers:
              15 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: