Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0001588 [Resin] minor sometimes 01-26-07 04:15 04-06-07 15:16
Reporter bjornm View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.0.20
Summary 0001588: Hessian SerializerFactory HashMaps involved in 100% CPU infinite loop?
Description During load tests to HessianServlets, we've sometimes experienced that the jvm would hang with 100% cpu. Thread dumps showed many threads were busy in HashMap.get:

"http-" daemon prio=1 tid=0x465bfbd8 nid=0x64e2 runnable [0x3f371000..0x3f3721b0]
        at java.util.HashMap.get(
        at com.caucho.hessian.server.HessianSkeleton.invoke(
        at com.caucho.hessian.server.HessianServlet.service(

A look at SerializerFactory shows it uses a set of hashmaps which are not synchronized:

  private HashMap _cachedSerializerMap;
  private HashMap _cachedDeserializerMap;
  private HashMap _cachedTypeDeserializerMap;

My guess is that if a HessianServlet receives many simultaneous calls during startup (when the maps are empty), concurrent read and write to the _cachedSerializerMap could cause this behavior. If this is the case, I suggest wrapping them in synchronizers:

_cachedDeserializerMap = Collections.synchronizedMap(new HashMap(8));

I have however been unable to reproduce this in some simple tests. Maybe someone who is more familiar with the code could advise.
Additional Information About infinite loops in unsynchronized HashMaps: [^]
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
01-26-07 04:15 bjornm New Issue
04-06-07 15:16 ferg Assigned To  => ferg
04-06-07 15:16 ferg Status new => closed
04-06-07 15:16 ferg Resolution open => fixed
04-06-07 15:16 ferg Fixed in Version  => 3.1.1

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
27 total queries executed.
25 unique queries executed.
Powered by Mantis Bugtracker