]
Karsten Blees updated ISPN-5562:
--------------------------------
Git Pull Request:
AsyncCacheWriter should write all data to the back-end store before
shutting down
---------------------------------------------------------------------------------
Key: ISPN-5562
URL:
https://issues.jboss.org/browse/ISPN-5562
Project: Infinispan
Issue Type: Bug
Components: Loaders and Stores
Affects Versions: 5.2.0.Final, 6.0.0.Final, 7.0.0.Final
Reporter: Karsten Blees
There is a chance that AsyncCacheWriter may stop before writing all midifications to the
back-end store. This can primarily happen when writing the same keys in rapid succession.
The coordinator thread will move these modifications to the head state (because of
conflicts with tail), which is not checked before shutdown.
There are two other minor race conditions if stop() is called concurrently to write() or
clear() - these cannot happen in practice because PassivationManager is stopped before
PersistenceManager:
1. AsyncStoreCoordinator checks State.stopped and State.modifications.isEmpty() without
holding the readLock(). This is not reliable because a concurrent write() or remove() may
still add to the modifications map.
2. clear() just replaces the head state, without copying the stopped flag that may have
been set by a concurrent stop().