jpos / jPOS

jPOS Project
http://jpos.org
GNU Affero General Public License v3.0
598 stars 456 forks source link

ConcurrentModificationException in ISOMsg.dump #319

Open chhil opened 4 years ago

chhil commented 4 years ago

Jmeter with a ISO8583 sampler that uses jpos 2.1.4

I initially logged this at https://github.com/tilln/jmeter-iso8583/issues/24 but seems to be a jpos issue.

java.util.ConcurrentModificationException: null
    at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1211) ~[?:1.8.0_152]
    at java.util.TreeMap$KeyIterator.next(TreeMap.java:1265) ~[?:1.8.0_152]
    at org.jpos.iso.ISOMsg.dump(ISOMsg.java:522) ~[jpos-2.1.4.jar:2.1.4]
    at nz.co.breakpoint.jmeter.iso8583.MessagePrinter.asString(MessagePrinter.java:19) ~[jmeter-iso8583-1.1.jar:?]
    at nz.co.breakpoint.jmeter.iso8583.ISO8583Sampler.sample(ISO8583Sampler.java:153) ~[jmeter-iso8583-1.1.jar:?]
    at org.apache.jmeter.threads.JMeterThread.doSampling(JMeterThread.java:627) ~[ApacheJMeter_core.jar:5.2.1]
    at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:551) ~[ApacheJMeter_core.jar:5.2.1]
    at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:490) [ApacheJMeter_core.jar:5.2.1]
    at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257) [ApacheJMeter_core.jar:5.2.1]
    at java.lang.Thread.run(Thread.java:748) [?:1.8.0_152]
ar commented 4 years ago

This problem seems to be related to JMeter's use (or re-use) of ISOMsgs.

We had a similar problem in issue #212 solved in 42f58b17511d1c85df979378ede2d9444e0acfba. Perhaps we can use a similar technique in ISOMsg.dump.