• Bug
  • Status: Closed
  • 0 Showstopper
  • Resolution: Fixed
  • hsingh
  • Reporter: hsingh
  • November 25, 2009
  • 0
  • Watchers: 0
  • January 17, 2013
  • November 25, 2009

Description

While running ohsm test with tc clustered ehcache 1.7.1-SNAPSHOT got following exception.

java.lang.UnsupportedOperationException: ElementData represents the Element, but w/o the key. To get to the element, call createElement(Object): Element at net.sf.ehcache.AbstractElementData.getValue(AbstractElementData.java:58) at net.sf.ehcache.AbstractElementData.getValue(AbstractElementData.java:13) at org.terracotta.cache.value.AbstractStatelessTimestampedValue.hashCode(AbstractStatelessTimestampedValue.java:153) at org.terracotta.cache.evictor.TargetCapacityEvictor$DetachedEntry.hashCode(TargetCapacityEvictor.java:280) at java.util.HashMap.__tc_put(Unknown Source) at java.util.HashMap.put(Unknown Source) at java.util.HashSet.__tc_add(HashSet.java:200) at java.util.HashSet.add(HashSet.java) at org.terracotta.cache.evictor.TargetCapacityEvictor.evictLocalElement(TargetCapacityEvictor.java:111) at org.terracotta.cache.evictor.TargetCapacityEvictor.evictLocalElements(TargetCapacityEvictor.java:65) at org.terracotta.cache.evictor.TargetCapacityMapSizeListener.localSizeChanged(TargetCapacityMapSizeListener.java:55) at org.terracotta.collections.ConcurrentDistributedMapDso.localSizeIncrement(ConcurrentDistributedMapDso.java:1206) at org.terracotta.collections.ConcurrentDistributedMapDso.putNoReturn(ConcurrentDistributedMapDso.java:280) at org.terracotta.collections.ConcurrentDistributedMapDsoArray.putNoReturn(ConcurrentDistributedMapDsoArray.java:117) at org.terracotta.collections.ConcurrentDistributedMap.putNoReturn(ConcurrentDistributedMap.java:189) at org.terracotta.cache.impl.DistributedCacheImpl.putNoReturn(DistributedCacheImpl.java:363) at org.terracotta.modules.ehcache.store.ClusteredStore.put(ClusteredStore.java:96) at net.sf.ehcache.Cache.put(Cache.java:876) at net.sf.ehcache.Cache.put(Cache.java:811) : : : at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:619)

Comments

Alex Miller 2009-11-25

We made two changes for this. Chris has modified tim-distributed-cache so that the capacity evictor no longer relies on the hashcode of the value. I made a change in the Ehcache implementation of the timestamp value to return the value for getValue() instead of throwing USOE. I also added a test (first) to reproduce the behavior and verified these fixed the problem.

Himadri Singh 2009-11-26

Verified in

2009-11-26 00:41:29,497 [main] INFO com.tc.plugins.ModulesLoader - BuildInfo for module: org.terracotta.modules.tim-ehcache-1.7 BuildInfo-User: bench BuildInfo-Revision: 19499 BuildInfo-Timestamp: 20091126-003426 BuildInfo-URL: https://svn.terracotta.org/repo/forge/projects/tim-ehcache/trunk/tim-ehcache-1.7 BuildInfo-Host: perf37

2009-11-26 01:25:27,901 [main] INFO com.tc.plugins.ModulesLoader - BuildInfo for module: org.terracotta.modules.tim-distributed-cache BuildInfo-User: bench BuildInfo-Revision: 19497 BuildInfo-Timestamp: 20091126-011659 BuildInfo-URL: https://svn.terracotta.org/repo/forge/projects/tim-distributed-cache/trunk/tim-distributed-cache BuildInfo-Host: perf37