Bug 53171 - Deadlock under Java 7 / DefaultInstanceManager
Deadlock under Java 7 / DefaultInstanceManager
Status: RESOLVED INVALID
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.27
PC Linux
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-05-01 10:58 UTC by Bob
Modified: 2012-05-29 13:29 UTC (History)
0 users



Attachments
Changing the Hashmap by Collections.synchonizedMap() (4.26 KB, application/octet-stream)
2012-05-01 10:58 UTC, Bob
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bob 2012-05-01 10:58:32 UTC
Created attachment 28703 [details]
Changing the Hashmap by Collections.synchonizedMap()

Not sure if it is java 7 related, but I had repeatetly that deadlock when I got the srver under some load. A simple replacement of the HashMap by a synchonized one did help (patch attached); but I dont know if that is a good solution as I dont get the idea of the AnnotationCache.

http-apr-80-exec-348" daemon prio=10 tid=0x00007f4f64da9000 nid=0x6306 waiting for monitor entry [0x00007f4f46cd7000]
   java.lang.Thread.State: BLOCKED (on object monitor)
	at org.apache.catalina.core.DefaultInstanceManager.populateAnnotationsCache(DefaultInstanceManager.java:256)
	- waiting to lock <0x00000007063b3d90> (a java.util.WeakHashMap)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:143)
	at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:137)
	at org.apache.jsp.templates.web.templates.s2.inc_005fcategory_jsp._jspx_meth_ox_005fifexists_005f1(inc_005fcategory_jsp.java:708)
	at org.apache.jsp.templates.web.templates.s2.inc_005fcategory_jsp._jspx_meth_ox_005frepeat_005f0(inc_005fcategory_jsp.java:118)
	at org.apache.jsp.templates.web.templates.s2.inc_005fcategory_jsp._jspService(inc_005fcategory_jsp.java:70)
	at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
	at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
	at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
Comment 1 Mark Thomas 2012-05-29 13:29:55 UTC
There is no evidence of a deadlock provided in this bug report. Please follow up on the users mailing list. Feel free to re-open this report once some evidence of a deadlock is available.