New jcstress concurrency stress testing module #1054
+1,176
−44
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introduce jcstress module for concurrency stress testing.
Changes
quickfix.JdbcStore
to allow testingNotes
I wrote two tests intially. One for
quickfix.JdbcStore
and one forquickfix.MemoryStore
as a starter.Each test encapsulates only a MemoryStore implementation, but both tests assume that sequence increment is guarded by their respective reentrant lock (which I'm not entirely sure about that this happens everywhere in the code).
Stress test clearly shows that there are concurrency issues in
quickfix.JdbcStore
implementation - #357. See commens in JdbcStoreStressTest.java. This errors are rare - < 0.01% under specific circumstances.I think there might be more issues related to reading sequences by different threads e.g. "QFJ Message Processor" thread reading stale sender sequences modified by application threads, but it is hard to confirm.
I hope that I got the mocks right for
quickfix.JdbcStore
test. Let me know if you see any value in this.