ActiveMQ.NMS hangs sometimes due t concurrency problems and static IDictionary
------------------------------------------------------------------------------
Key: AMQNET-381
URL: https://issues.apache.org/jira/browse/AMQNET-381
Project: ActiveMQ .Net
Issue Type: Bug
Components: NMS
Affects Versions: 1.5.4
Environment: Windows Server 2008
Reporter: Sergei Sokolov
Assignee: Jim Gomes
Attachments: TransportFactory.cs.patch
I've found that rarely .NET process consumes ~90% CPU. I got the dump file and
I found that the problem is in Dictionary<>.FindEntry method:
{code}
2de9e5a4 71711819 System.Collections.Generic.Dictionary`2[[System.__Canon,
mscorlib],[System.__Canon, mscorlib]].FindEntry(System.__Canon)
2de9e5c4 716937f5 System.Collections.Generic.Dictionary`2[[System.__Canon,
mscorlib],[System.__Canon, mscorlib]].ContainsKey(System.__Canon)
2de9e5c8 2aabdade
Apache.NMS.ActiveMQ.Transport.TransportFactory.FindTransportFactory(System.String)
2de9e614 2aabd983
Apache.NMS.ActiveMQ.Transport.TransportFactory.NewInstance(System.String)
2de9e680 2aabd865
Apache.NMS.ActiveMQ.Transport.TransportFactory.CreateTransportFactory(System.Uri)
2de9e6f0 2aabd73b
Apache.NMS.ActiveMQ.Transport.TransportFactory.CreateTransport(System.Uri)
2de9e70c 2aabd4f1
Apache.NMS.ActiveMQ.ConnectionFactory.CreateActiveMQConnection(System.String,
System.String)
2de9e7a0 2aabd40a
Apache.NMS.ActiveMQ.ConnectionFactory.CreateActiveMQConnection()
2de9e7b8 2aabd3a8 Apache.NMS.ActiveMQ.ConnectionFactory.CreateConnection()
{code}
I've searched for the solution and found a good article of Tess Ferrandez,
explaining the situation -
http://blogs.msdn.com/b/tess/archive/2009/12/21/high-cpu-in-net-app-using-a-static-generic-dictionary.aspx
It seems that all access to static Dictionary classes should be synchronized.
I've added lock statements in the TransportFactory class to all appropriate
places.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira