Saving a snapshot many times for a short time causes SaveSnapshotFailure
I am using the UntypedProcessor to store a state of an Actor. My program calls the saveSnapshot method whenever one of child actors finishes. As the SnapshotStore stores a snapshot asynchronously, calling the saveSnapshot method while it is saving a snapshot corrupts the SnapshotStore that it keeps failing on saving a snapshot. Anyone has an idea of saving a snapshot in a better way? It would be great if this method can be done either synchronous or asynchronous by giving an extra parameter.
Leave a comment
on 2014-04-11 06:38 *
By Patrik Nordwall
Assigned to set to Patrik Nordwall
Status changed from New to Accepted
on 2014-04-11 07:31 *
By Patrik Nordwall
@njovy I tried this, but I can't reproduce it.
I can call saveSnapshot 1000 times in a tight loop, and I even added some random delay in the saving part.
Can you please provide a test or sample that we can use to reproduce the problem.
I can call saveSnapshot 1000 times in a tight loop, and I even added some random delay in the saving part.
Can you please provide a test or sample that we can use to reproduce the problem.
on 2014-04-14 01:07 *
By Patrik Nordwall
@njovy The instance that you pass to saveSnapshot must be immutable (or not changed), because the serialization for storage is performed by another thread. If your actor continues to modify the instance the serialization might be corrupt. Can this be the reason?
on 2014-04-14 05:34 *
By Patrik Nordwall
@njovy ok, did that solve the problem, or was it already in place when you noticed the failures. In the latter case I would be interested in code to reproduce. Then we should continue at github issue: https://github.com/akka/akka/issues/13988 (we have just migrated away from Assembla)