Mantis - Resin
Viewing Issue Advanced Details
3620 major sometimes 08-03-09 12:04 08-12-09 16:33
ebarlas  
ferg  
normal  
closed 3.0.21  
fixed  
none    
none 4.0.2  
0003620: _attrGetMap instance variable in IntrospectionMBean class should be synchronized
The _attrGetMap field in IntrospectionMBean class should be synchronized, as the same IntrospectionMBean can be accessed by multiple threads. This can result in corruption of the HashMap. In fact, two threads may resize the HashMap at the same time on a put, which can cause a cycle in a linked list of entries in the HashMap. If this occurs, a get on the map for a key that does not exist may enter an infinite loop. We have reproduced this behavior. See excerpt from stack trace below. This thread has been in this state for about 3 days now.

"resin-tcp-connection-lt2fe5.qai.expertcity.com:8080-27" daemon prio=10 tid=0x000000004461c400 nid=0x3fb0 runnable [0x0000000042012000..0x0000000042013d90]
   java.lang.Thread.State: RUNNABLE
        at java.util.HashMap.get(HashMap.java:303)
        at com.caucho.jmx.IntrospectionMBean.getGetMethod(IntrospectionMBean.java:209)
        at com.caucho.jmx.IntrospectionMBean.getAttribute(IntrospectionMBean.java:115)
        at com.caucho.jmx.MBeanWrapper.getAttribute(MBeanWrapper.java:169)
        at com.caucho.jmx.AbstractMBeanServer.getAttribute(AbstractMBeanServer.java:654)
        at
...
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
        at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
        at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)

 

Notes
(0004112)
ebarlas   
08-03-09 12:14   
The simplest fix would be to use a Hashtable instead of a HashMap