activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gary Tully (JIRA)" <j...@apache.org>
Subject [jira] [Reopened] (AMQ-5016) BitArrayBin doesn't work well with index larger than Integer.MAX_VALUE
Date Tue, 05 Aug 2014 15:52:14 GMT

     [ https://issues.apache.org/jira/browse/AMQ-5016?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gary Tully reopened AMQ-5016:
-----------------------------


the fix breaks serializability and as a result reading the producer audit from the store.
I guess we need to declare incompatibility and use a new serialVersionUID or maybe implement
a custom read that can deal with migration.
I came across this exception{code}2014-08-05 15:24:07,992 [main           ] - WARN  MessageDatabase
               - Cannot recover message audit
java.io.InvalidClassException: org.apache.activemq.util.BitArrayBin; incompatible types for
field firstIndex
	at java.io.ObjectStreamClass.matchFields(ObjectStreamClass.java:2254)
	at java.io.ObjectStreamClass.getReflector(ObjectStreamClass.java:2149)
	at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:657)
	at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1622)
	at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
	at java.util.HashMap.readObject(HashMap.java:1180)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:1017)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1893)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
	at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1990)
	at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1915)
	at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1798)
	at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350)
	at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370)
	at org.apache.activemq.store.kahadb.MessageDatabase.recoverProducerAudit(MessageDatabase.java:692)
	at org.apache.activemq.store.kahadb.MessageDatabase.recover(MessageDatabase.java:595)
	at org.apache.activemq.store.kahadb.MessageDatabase.open(MessageDatabase.java:400)
	at org.apache.activemq.store.kahadb.MessageDatabase.load(MessageDatabase.java:418)
	at org.apache.activemq.store.kahadb.MessageDatabase.doStart(MessageDatabase.java:262)
	at org.apache.activemq.store.kahadb.KahaDBStore.doStart(KahaDBStore.java:204)
	at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
	at org.apache.activemq.store.kahadb.KahaDBPersistenceAdapter.doStart(KahaDBPersistenceAdapter.java:223)
	at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:55)
	at org.apache.activemq.broker.BrokerService.doStartPersistenceAdapter(BrokerService.java:642)
	at org.apache.activemq.broker.BrokerService.startPersistenceAdapter(BrokerService.java:631)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:596)
	at org.apache.activemq.broker.Main.main(Main.java:50)
2014-08-05 15:24:08,000 [main           ] - INFO  MessageDatabase                - Recovering
from the journal ...
2014-08-05 15:24:09,639 [main           ] - INFO  MessageDatabase                - @8:3797562,
100000 entries recovered ..
{code} which is fairly ugly.

> BitArrayBin doesn't work well with index larger than Integer.MAX_VALUE
> ----------------------------------------------------------------------
>
>                 Key: AMQ-5016
>                 URL: https://issues.apache.org/jira/browse/AMQ-5016
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: JMS client
>    Affects Versions: 5.9.0
>            Reporter: Dan Yu
>             Fix For: 5.11.0
>
>         Attachments: BitArrayBinTest.java
>
>
> In BitArrayBin class, the index's unit type is long. It also has a variable called firstIndex,
which store the index where the window starts. And that firstindex's unit is int. If the index
is bigger than Integer.MAX_VALUE, setBit() and getBit() starts to return bad value.
> The defect causes activemq client to perform badly when receiving message that sequence
id is bigger than max interger. It spends most of the time to shift window, and also blocks
other consumer threads. Below is the jstack log that shows the problem.
> {code}
> "ActiveMQ Session Task-869879" prio=10 tid=0x00007f412d6ee000 nid=0x3cbe runnable [0x00007f405b7b6000]
>    java.lang.Thread.State: RUNNABLE
>         at java.util.LinkedList.linkLast(LinkedList.java:140)
>         at java.util.LinkedList.add(LinkedList.java:336)
>         at org.apache.activemq.util.BitArrayBin.getBitArray(BitArrayBin.java:123)
>         at org.apache.activemq.util.BitArrayBin.setBit(BitArrayBin.java:59)
>         at org.apache.activemq.ActiveMQMessage AuditNoSync.isDuplicate(ActiveMQMessageAuditNoSyn
c.java:160)
>         at org.apache.activemq.ActiveMQMessageAudit.isDuplicate(ActiveMQMessageAudit.java:59)
>         - locked <0x00007f46a0138ab0> (a org.apache.activemq.ActiveMQMessageAudit)
>         at org.apache.activemq.ActiveMQMessage AuditNoSync.isDuplicate(ActiveMQMessageAuditNoSyn
c.java:140)
>         at org.apache.activemq.ConnectionAudit.isDuplicate(ConnectionAudit.java:52)
>         - locked <0x00007f4881e6b968> (a org.apache.activemq.ConnectionAudit)
>         at org.apache.activemq.ActiveMQConnection.isDuplicate(ActiveMQConnection.java:2291)
>         at org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1223)
>         - locked <0x00007f45db222fb8> (a java.lang.Object)
>         at org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:134)
>         at org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:205)
>         at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:127)
>         at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:48)
>         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>         at java.lang.Thread.run(Thread.java:722)
> {code}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message