if(valueToSwap.tryAcquireMutex()) {
try {
if(valueToSwap.canBePersisted()) {
- valueToSwap.persist();
- return true;
+ boolean persist = valueToSwap.persist();
+ if (!persist) {
+ LOGGER.error("\n Somehow valueToSwap {} could not be persisted even though canBePersisted returned true\n", valueToSwap);
+ LOGGER.error("priorityQueue.size() {}", priorityQueue.size());
+ if (priorityQueue.size() > 0) {
+ LOGGER.error("priorityQueue first entry {}", priorityQueue.entrySet().iterator().next());
+ }
+ LOGGER.error("map.size() {}", map.size());
+ if (map.size() > 0) {
+ LOGGER.error("map first entry {}", map.entrySet().iterator().next());
+ }
+ }
+ return persist;
}
} catch (Throwable t) {
throw new IllegalAcornStateException(t);