Details
Description
The root cause is actually very simple.
1) Multiple threads call convert(String) for a new day [new = wasn't already in dateCache]
2) Multiple threads get a handle to the same new GregorianCalendar instance for the new day
3) Multiple threads concurrently call getTimeInMillis() for the same instance from step #2
4) ArrayIndexOutOfBoundsException due to concurrent modification of internal GregorianCalendar state
Example stack trace
Caused by: java.lang.ArrayIndexOutOfBoundsException: 101
at sun.util.calendar.BaseCalendar.getCalendarDateFromFixedDate(BaseCalendar.java:454)
at java.util.GregorianCalendar.computeFields(GregorianCalendar.java:2333)
at java.util.GregorianCalendar.computeTime(GregorianCalendar.java:2753)
at java.util.Calendar.updateTime(Calendar.java:2606)
at java.util.Calendar.getTimeInMillis(Calendar.java:1118)
at quickfix.field.converter.UtcTimestampConverter.convert(UtcTimestampConverter.java:82)
at quickfix.FieldMap.getField(FieldMap.java:432)
at quickfix.fix44.MarketDataIncrementalRefresh$NoMDEntries.getExpireTime(MarketDataIncrementalRefresh.java:2001)
There are many easy ways to fix this. I would even suggest just storing the millis in the dateCache