Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Later
-
None
-
None
Description
Description of problem:
The java client removes transacted sessions during failover. This removal is
not safe however, since it happens when the Hashmap of sessions is being
iterated through. This occasionally results in a
ConcurrentModificationException.
How reproducible:
Always
Steps to Reproduce:
1. Run attached program
Actual results:
ERROR [IoReceiver - localhost/127.0.0.1:5672]
(AMQConnectionDelegate_0_10.java:281) - error during failover
java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(HashMap.java:810)
at java.util.HashMap$ValueIterator.next(HashMap.java:839)
at org.apache.qpid.transport.Connection.resume(Connection.java:469)
at
org.apache.qpid.client.AMQConnectionDelegate_0_10.resubscribeSessions(AMQConnectionDelegate_0_10.java:221)
at
org.apache.qpid.client.AMQConnection.resubscribeSessions(AMQConnection.java:1207)
at
org.apache.qpid.client.AMQConnectionDelegate_0_10.closed(AMQConnectionDelegate_0_10.java:274)
at org.apache.qpid.transport.Connection.closed(Connection.java:561)
at org.apache.qpid.transport.network.Assembler.closed(Assembler.java:110)
at
org.apache.qpid.transport.network.InputHandler.closed(InputHandler.java:202)
at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:150)
at java.lang.Thread.run(Thread.java:636)
ERROR [IoReceiver - localhost/127.0.0.1:5672]
(AMQConnectionDelegate_0_10.java:293) - connection exception: conn:3749eb9f
org.apache.qpid.transport.ConnectionException: connection aborted
at org.apache.qpid.transport.Connection.closed(Connection.java:534)
at org.apache.qpid.transport.network.Assembler.closed(Assembler.java:110)
at
org.apache.qpid.transport.network.InputHandler.closed(InputHandler.java:202)
at org.apache.qpid.transport.network.io.IoReceiver.run(IoReceiver.java:150)
at java.lang.Thread.run(Thread.java:636)
Expected results:
Successful failover
Additional info:
Logging options (log4j.properties):
log4j.rootLogger=debug, stdout, R
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
- Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] (%F:%L) - %m%n
log4j.appender.R=org.apache.log4j.FileAppender
log4j.appender.R.File=example.log
log4j.appender.R.MaxFileSize=100000000KB
- Keep one backup file
log4j.appender.R.MaxBackupIndex=1
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.logger.org.apache=TRACE