Iron SPI file get stuck after many transactions
gvauvert opened this issue · 4 comments
Description
Iron SPI file get stuck under highly concurrent access :
How to reproduce
Reproduction Steps
- Apply patch HighlyConcurrentFileStoreTest.zip
- Run the test (Not Debug, because it does not get stuck in Debug)
Actual result
- After minutes, no more transactions are created (around 3 000 are created, but 10 000 expected) - see iron\iron\iron-spi-file-inttest\iron-store-XXX\tx
- Never terminates
Expected result
- Terminates after 10 000 transactions
l64 is just debug "print" you should comment it otherwise it would last forever
_HighlyConcurrentFileStoreTest_V2.zip
--> debug approximately 54s
Snapshots.zip
2 snapshot, one during debug and one during run
we can use the compare funtion of yourkit to see the difference of time.
After many transactions, iron get stuck because
Cache<String, CompletableFuture<List<Object>>> io.axway.iron.core.internal.StoreManagerImpl#m_futuresBySynchronizationId
removes values when it is full.
These values should not be removed because wrapped by CommandFutureWrapper to be retained as string reference:
Directly send every calls to the wrapped {@code Future}. This class is needed to retain a strong reference to the underlying transaction {@code Future}. So it prevents the transaction {@code Future} to be evicted from the {@link #m_futuresBySynchronizationId} weak cache, giving the opportunity to the transaction {@code Future} to be completed, and so the command {@code Future} can complete also. private static final class CommandFutureWrapper<T> implements Future<T> {
Fixed in iron 0.18.0