Our public facing Confluence instance recently stopped responding. When we analyzed the thread dump, we found that all the tcp threads were waiting for Database Connections, except for the 50 which were trying to get Calendars. Those 50 were listening on a Socket, like this:
"resin-tcp-connection-j2ee.confluence.atlassian.com:6802-261" daemon prio=1 tid=0x0000002afa4f6e40 nid=0x6fd1 runnable [0x0000000044693000..0x0000000044697b30]
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:129)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
- locked <0x0000002ad3b27c10> (a java.io.BufferedInputStream)
at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:659)
at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:604)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:961)
- locked <0x0000002ad3b27d08> (a sun.net.www.protocol.http.HttpURLConnection)
at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:1899)
at java.net.URLConnection.getContentType(URLConnection.java:479)
at org.randombits.source.URLSource.createReader(URLSource.java:109)
at org.randombits.source.BaseSource.openReader(BaseSource.java:63)
at com.atlassian.confluence.extra.calendar.ical.model.ICalCalendar.getCalendar(ICalCalendar.java:205)
at com.atlassian.confluence.extra.calendar.ical.model.ICalCalendar.initDetails(ICalCalendar.java:115)
I'll attach a full example stack trace from the thread dump too.
There were no errors in the log from the calendar plugin, aside from failures to get Database Connections once all the Database Connections were in use.