Greetings,

we have recently run into a concurrency issue in an entry processor.

Suppose we have a cache that is IgniteCache<Long, HashMap<String, String>>.
Entries in this cache are added and modified solely via EntryProcessors.

Now suppose that the cache contains a value for key 1L - a map with several key value pairs. Next suppose, we execute the same entry processor for the key 1L TWICE at the very same time on the same value.

Up until now my understanding was that since the HashMap is stored offheap, each entry processor would get it's own deserialized copy of the HashMap for modification and Ignite would then orchestrate the update of the value (serializing/deserializing the value to offheap reagion).

However, what we see in our test case is that both entry processor "executions" receive the same deserialized HashMap and thus the modification of the HashMap in both processors at the same time causes java.util.ConcurrentModificationException.

I would expect this kind of behaviour in case the HashMap was stored on regular Java heap but if the value is deserialized from offheap region? Is my logic correct? I am trying to wrap my head around this but does this mean that any complex datastractures stored in must require separate locking?

Thanks!

Kamil

Reply via email to