I have a tomcat application, and currently started just one node, multicast mode
I am populating a cache and proceeded to lock the map, but when there is data to put, the application never returns since it is trying to repartition, but there is ONLY one node and no data existed before.
If I do not lock the map, then it works.
ICache is a wrapper on the IMap. Most ICache methods are the same as IMap's. ICache.lock(long, TimeUnit) calls IMap.lockMap(long, TimeUnit)
This is the code
public void replaceSectionSlots(final Map inReplacement) {
ICache<String, Set<Positionable>> sectionSlotCache = getYardSectionSlotCache();
// It should not be null.
if (sectionSlotCache != null) {
boolean locked = false;
try {
locked = sectionSlotCache.lock(500, TimeUnit.MILLISECONDS);
if (locked) {
sectionSlotCache.removeAll(); // There is no data; it never returns
sectionSlotCache.putAll(inReplacement);
// Section Slot observers should be notified
LOGGER.debug("replaceSectionSlots");
}
} catch (Throwable thr) {
LOGGER.error("Could not replace all blocks. Exception: " + thr.getMessage());
} finally {
if (locked) {
sectionSlotCache.unlock();
}
}
}
}
//// This is the log
2012-05-02 16:02:21,449 DEBUG [hz.navis-instance.ServiceThread ] [FactoryImpl:809] ( ) /
134.37.94.111:5701 [navis_dev] Instance created ProxyKey {name='c:dynamicViewsCache-9-blockSlot', key=null}
2012-05-02 16:03:00,539 DEBUG [hz.navis-instance.scheduled.thread-1] [CMap:91] ( ) /
134.37.94.111:5701 [navis_dev] c:dynamicViewsCache-9-blockSlot Cleanup , dirty:0, purge:0, evict:0, unknown:0, stillOwned:0, backupPurge:0
2012-05-02 16:03:00,519 DEBUG [hz.navis-instance.scheduled.thread-2] [PartitionManager:?] ( ) /
134.37.94.111:5701 [navis_dev] Checking partition table for repartitioning...
2012-05-02 16:03:03,680 DEBUG [hz.navis-instance.cached.thread-6 ] [ConcurrentMapManager:?] ( ) /
134.37.94.111:5701 [navis_dev] CONCURRENT_MAP_SET BeforeRedo target Address[
134.37.94.111:5701]
2012-05-02 16:03:04,181 DEBUG [hz.navis-instance.cached.thread-6 ] [ConcurrentMapManager:?] ( ) /
134.37.94.111:5701 [navis_dev] CONCURRENT_MAP_SET BeforeRedo target Address[
134.37.94.111:5701]
2012-05-02 16:03:04,681 DEBUG [hz.navis-instance.cached.thread-6 ] [ConcurrentMapManager:?] ( ) /
134.37.94.111:5701 [navis_dev] CONCURRENT_MAP_SET BeforeRedo target Address[
134.37.94.111:5701]
2012-05-02 16:03:05,181 DEBUG [hz.navis-instance.cached.thread-6 ] [ConcurrentMapManager:?] ( ) /
134.37.94.111:5701 [navis_dev] CONCURRENT_MAP_SET BeforeRedo target Address[
134.37.94.111:5701]
....