Within the class ReplicationOperation the list of peers that are used
to store replicates is send to other peers. But sadly the list is not
cloned/copied.
I’m talking about the replicatorNodes list in the ReplicationOperation
class. At line 108/109 this list put into a StoreReplicationMessage.
From there on the list is passed to the method
handleStoreReplicationMessage of ReplicationDHTService class. This
method puts the list into a ReplicationDHTObject. When a new root for
a file has to be selected, the list from this ReplicationDHTObject is
altered by the the method handleNewRootMessage of the
ReplicationDHTSerivce class. Because the list is not cloned/copied at
any point, all variables along the way point to the same list. Since
only the reference is copied.
During the handleNewRootMessage method an item of the list is deleted.
Because the recipient list of the RelationOperation class is in some
cases equal to the replicatorNodes list, it can come to a
IndexOfOutBounceException in the method sendMessageSucceeded and
sendMessageFailed of the ReplicationOperation class. Because the
message number of recipients is no longer equal to the number of
messages that were sent.
I think I solved the problem by creating copies of the list every time
it is send.
If needed I could post a description how to recreate this problem/the
exception