You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Gary Tully (JIRA)" <ji...@apache.org> on 2015/09/28 14:01:04 UTC

[jira] [Created] (AMQ-5984) Unsafe use of access-order LinkedHashMap via ActiveMQMessageAuditNoSync - can lead to loop and hang

Gary Tully created AMQ-5984:
-------------------------------

             Summary: Unsafe use of access-order LinkedHashMap via  ActiveMQMessageAuditNoSync - can lead to loop and hang
                 Key: AMQ-5984
                 URL: https://issues.apache.org/jira/browse/AMQ-5984
             Project: ActiveMQ
          Issue Type: Bug
          Components: Broker
    Affects Versions: 5.12.0
            Reporter: Gary Tully
            Assignee: Gary Tully
             Fix For: 5.13.0


A thread looping in{code}"ActiveMQ Transport: tcp:///xxx:yyy@61616" daemon prio=10 tid=0x00007efff40a3000 nid=0x74f0 runnable [0x00007eff6f0f9000]
   java.lang.Thread.State: RUNNABLE
	at java.util.LinkedHashMap.transfer(LinkedHashMap.java:253)
	at java.util.HashMap.resize(HashMap.java:581)
	at java.util.HashMap.addEntry(HashMap.java:879)
	at java.util.LinkedHashMap.addEntry(LinkedHashMap.java:427)
	at java.util.HashMap.put(HashMap.java:505)
	at org.apache.activemq.ActiveMQMessageAuditNoSync.isDuplicate(ActiveMQMessageAuditNoSync.java:133)
	at org.apache.activemq.store.kahadb.MessageDatabase.upadateIndex(MessageDatabase.java:1238)
	at org.apache.activemq.store.kahadb.MessageDatabase$AddOpperation.execute(MessageDatabase.java:2196)
	at org.apache.activemq.store.kahadb.MessageDatabase$15.execute(MessageDatabase.java:1141)
	at org.apache.activemq.store.kahadb.disk.page.Transaction.execute(Transaction.java:779)
	at org.apache.activemq.store.kahadb.MessageDatabase.process(MessageDatabase.java:1137)
	at org.apache.activemq.store.kahadb.MessageDatabase$10.visit(MessageDatabase.java:1005)
	at org.apache.activemq.store.kahadb.data.KahaCommitCommand.visit(KahaCommitCommand.java:130)....{code}

points to the need for a write lock on access to the LRUCache used for duplicate detection for failover producers.
The index lock protects modifications on put etc but clearly a get needs to have exclusive access. Tis in the javadoc in bold - "In access-ordered linked hash maps, merely querying the map with get is a structural modification"



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)