[
https://issues.redhat.com/browse/ISPN-12062?page=com.atlassian.jira.plugi...
]
Nistor Adrian commented on ISPN-12062:
--------------------------------------
But we could be in luck if looking elsewhere. Some marshalling formats, like protobuf, do
not write the size for collections, just the elements, so they would never visibly
experience the issue in a catastrophic manner. But the problem still remains, in user
code: an object should never be modified after it was handed over to the marshalling
layer, or after being put in the cache.
Fail fast if a collection is modified during marshalling
--------------------------------------------------------
Key: ISPN-12062
URL:
https://issues.redhat.com/browse/ISPN-12062
Project: Infinispan
Issue Type: Enhancement
Components: Marshalling
Affects Versions: 11.0.0.Final, 10.1.8.Final
Reporter: Dan Berindei
Priority: Major
Fix For: 12.0.0.Final
If a collection is modified by a different thread during marshalling, the serialization
usually fails with a {{ConcurrentModificationException}}. But in rare cases,
{{MarshallUti.marshallCollection()}} may succeed to write a size of {{X}} and then {{Y}}
elements.
{{MarshallUti.marshallCollection()}} could keep track of how many elements it writes and
throw an exception at the end if the number of elements it wrote is different from the
size it wrote.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)