We have a bunch of tests that are run for our caching layer. In between each test, we want to clear all of the data in the cache. As part of some of the tests, there are background writes that occur to the cache. We have some sleeps to account for this, but that is error prone and doesn't always work. When we use clear() for all of the IgniteCache objects in between tests, some tests will fail due to writes occurring during current test from the previous test or from data not being cleared from cache, not exactly sure. If removeAll is instead used, then we never seem to have this problem. However, occasionally the code will hang if removeAll is used. We use IgniteDataStreamer to write to the cache, so I have a couple of questions:
1. The difference between clear and removeAll seems to be that removeAll waits for various listeners. Does this explain why removeAll always works for us (besides when it hangs)? I don't believe we have a write through cache and we don't explicitly register CacheEntryRemovedListeners.
2. What could be the cause of removeAll hanging? Is it possible for there to be a timeout that is configured for this call?