Skip to main content

Application code running on "DistributedCache" service thread(s) should not call ensureCache as this may result in deadlock.

  3 posts   Feedicon  
Replies: 2 - Last Post: October 31, 2013 15:11
by: kkiran78
showing 1 - 3 of 3
Posted: October 22, 2013 14:39 by kkiran78
Hi,

I am planning to implement Coherence 12.1.2 Push replication for ACTIVE-ACTIVE pattern. I have 2 storage nodes and each storage node has one Cache partition. I am trying to implement Push replication (A-A) between these 2 nodes. The push replication works 100% well.

Even though, Push replication works, I some how get the below error i.e., I have the A-A pattern working and at the same time I have this exception.. Any help to evade the below error would be greatly appreciated:

2013-10-21 15:28:49.372/63.643 Oracle Coherence GE 12.1.2.0.0 <Warning> (thread=DistributedCacheWorker:3, member=1): Application code running on "DistributedCache" service thread(s) should not call ensureCache as this may result in deadlock. The most common case is a CacheFactory call from a custom CacheStore implementation.
2013-10-21 15:28:49.372/63.643 Oracle Coherence GE 12.1.2.0.0 <D7> (thread=DistributedCacheWorker:3, member=1): Stack trace:
	at com.tangosol.coherence.component.util.SafeService.checkClientThread(SafeService.CDB:38)
	at com.tangosol.coherence.component.util.safeService.SafeCacheService.ensureCache(SafeCacheService.CDB:8)
	at com.tangosol.coherence.config.scheme.AbstractCachingScheme.realizeCache(AbstractCachingScheme.java:59)
	at com.tangosol.coherence.config.scheme.AbstractBundlingScheme.realizeCache(AbstractBundlingScheme.java:31)
	at com.tangosol.net.ExtensibleConfigurableCacheFactory.ensureCache(ExtensibleConfigurableCacheFactory.java:254)
	at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:205)
	at com.tangosol.net.CacheFactory.getCache(CacheFactory.java:182)
	at com.oracle.coherence.common.builders.SerializableNamedCacheSerializerBuilder.realize(SerializableNamedCacheSerializerBuilder.java:109)
	at com.oracle.coherence.common.builders.SerializableNamedCacheSerializerBuilder.realize(SerializableNamedCacheSerializerBuilder.java:59)
	at com.oracle.coherence.patterns.eventdistribution.distributors.coherence.CoherenceEventDistributor.establishEventChannelController(CoherenceEventDistributor.java:149)
	at com.oracle.coherence.patterns.eventdistribution.configuration.EventDistributorTemplate.realize(EventDistributorTemplate.java:251)
	at com.oracle.coherence.patterns.pushreplication.PublishingCacheStore$1.ensureResource(PublishingCacheStore.java:194)
	at com.oracle.coherence.patterns.pushreplication.PublishingCacheStore$1.ensureResource(PublishingCacheStore.java:134)
	at com.oracle.coherence.common.resourcing.AbstractDeferredSingletonResourceProvider.getResource(AbstractDeferredSingletonResourceProvider.java:85)
	at com.oracle.coherence.patterns.pushreplication.PublishingCacheStore.distribute(PublishingCacheStore.java:210)
	at com.oracle.coherence.patterns.pushreplication.PublishingCacheStore.store(PublishingCacheStore.java:378)
	at com.tangosol.net.cache.ReadWriteBackingMap$BinaryEntryStoreWrapper.storeInternal(ReadWriteBackingMap.java:6101)
	at com.tangosol.net.cache.ReadWriteBackingMap$StoreWrapper.store(ReadWriteBackingMap.java:4879)
	at com.tangosol.net.cache.ReadWriteBackingMap.putInternal(ReadWriteBackingMap.java:1283)
	at com.tangosol.net.cache.ReadWriteBackingMap.put(ReadWriteBackingMap.java:745)
	at java.util.AbstractMap.putAll(Unknown Source)
	at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.putPrimaryResource(PartitionedCache.CDB:43)
	at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.postPut(PartitionedCache.CDB:32)
	at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$Storage.putAll(PartitionedCache.CDB:18)
	at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache.onPutAllRequest(PartitionedCache.CDB:54)
	at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$PutAllRequest$PutJob.run(PartitionedCache.CDB:1)
	at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:1)
	at com.tangosol.coherence.component.util.DaemonPool$WrapperTask.run(DaemonPool.CDB:32)
	at com.tangosol.coherence.component.util.DaemonPool$Daemon.onNotify(DaemonPool.CDB:66)
	at com.tangosol.coherence.component.util.Daemon.run(Daemon.CDB:51)
	at java.lang.Thread.run(Unknown Source)

Regards,
Kiran.
Posted: October 29, 2013 20:19 by brianoliver
While it seems like a problem, in the case of the exact call, it's ok as the ensureCache call is to another service. It serves as a warning of the potential for deadlock. ie: "may cause deadlock". In this case it won't.

-- Brian
Posted: October 31, 2013 15:11 by kkiran78
Thanks a lot Brian for your inputs!
I was even able to evade the stack trace by lowering the log level to 5 (default) as the log level of stack trace that I get is <D7>
I had the log level set to 9 earlier and that is why I get the stack trace.

Regards,
Kiran.
Replies: 2 - Last Post: October 31, 2013 15:11
by: kkiran78
 
 
Close
loading
Please Confirm
Close