Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent UserManagedCache hits NPE #1298

Closed
kedar031 opened this issue Jul 7, 2016 · 2 comments
Closed

Persistent UserManagedCache hits NPE #1298

kedar031 opened this issue Jul 7, 2016 · 2 comments
Assignees
Labels
Milestone

Comments

@kedar031
Copy link
Contributor

kedar031 commented Jul 7, 2016

Client version:

Implementation-Title: ehcache
Implementation-Version: 3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3
 e00709639

Settings:

Threads: 4
Elements: 100000
Configuration: heap(1) _disk(2GB)
Variation: [Cache level copier variation: [Key copier: LongCopier ,Value copier: CacheValueCopier], Cache level serializer variation: [Key serializer: LongSerializer ,Value serializer: CacheValueSerializer], TTL Expiry, Eviction Veto None]

In the scenario, puts done UserManagedCache configured with above settings and closed the cache, further when trying to reload the persisted cache data hits the below exception.

Please note that the same test worked fine sometime ago (don't have exact date/build history)

16:34:38.921 [pool-6-thread-1] INFO  o.e.c.i.r.LoggingRobustResilienceStrategy - Ehcache key 71791 recovered from
org.ehcache.core.spi.store.StoreAccessException: java.lang.NullPointerException
    at org.ehcache.impl.internal.store.heap.OnHeapStore.getOrComputeIfAbsent(OnHeapStore.java:747) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.impl.internal.store.tiering.TieredStore.get(TieredStore.java:110) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.core.Ehcache.get(Ehcache.java:167) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.core.PersistentUserManagedEhcache.get(PersistentUserManagedEhcache.java:148) [ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at com.terracotta.qa.ehcache.validation.ValidatingGetOperation.exec(ValidatingGetOperation.java:57) [classes/:na]
    at io.rainfall.ScenarioRun.initStatistics(ScenarioRun.java:284) [rainfall-core-1.1.3-20160703.112848-15.jar:na]
    at io.rainfall.ScenarioRun.start(ScenarioRun.java:135) [rainfall-core-1.1.3-20160703.112848-15.jar:na]
    at com.terracotta.qa.ehcache.tiering.test.UserManagedPersistenceCacheTest$2.call(UserManagedPersistenceCacheTest.java:172) [test-classes/:na]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [na:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [na:1.7.0_79]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [na:1.7.0_79]
    at java.lang.Thread.run(Thread.java:745) [na:1.7.0_79]
Caused by: java.lang.NullPointerException: null
    at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1124) ~[na:1.7.0_79]
    at org.ehcache.impl.serialization.CompactJavaSerializer$OIS.readClassDescriptor(CompactJavaSerializer.java:239) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1601) ~[na:1.7.0_79]
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1517) ~[na:1.7.0_79]
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1771) ~[na:1.7.0_79]
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1350) ~[na:1.7.0_79]
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:370) ~[na:1.7.0_79]
    at org.ehcache.impl.serialization.CompactJavaSerializer.read(CompactJavaSerializer.java:131) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.impl.internal.store.offheap.LazyOffHeapValueHolder.forceDeserialization(LazyOffHeapValueHolder.java:99) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.impl.internal.store.offheap.LazyOffHeapValueHolder.value(LazyOffHeapValueHolder.java:53) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.impl.internal.store.heap.OnHeapStore.cloneValueHolder(OnHeapStore.java:1455) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.impl.internal.store.heap.OnHeapStore.importValueFromLowerTier(OnHeapStore.java:1445) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    at org.ehcache.impl.internal.store.heap.OnHeapStore.getOrComputeIfAbsent(OnHeapStore.java:703) ~[ehcache-3.1.0-SNAPSHOT.jar:3.1.0-SNAPSHOT a6bf3bda6216c6b190b53114a46fbd3e00709639]
    ... 11 common frames omitted
@ljacomet ljacomet added the bug label Jul 11, 2016
@matt-isaman
Copy link

I ran into the same issue. I determined this was a bug in Ehcache after a bit of debugging through my code. The resolution for me was to downgrade my Ehcache version to 3.0.2 where this bug doesn't seem to exist. I tried importing 3.1.0 but that version doesn't appear to import correctly from Maven Central.

Here is the version that worked for me:

    <dependency>
      <groupId>org.ehcache</groupId>
      <artifactId>ehcache</artifactId>
      <version>3.0.2</version>
    </dependency>

@ljacomet
Copy link
Member

ljacomet commented Aug 1, 2016

That is indeed a bug introduced by 3.1.0 and present in 3.1.1 as well.

AbfrmBlr added a commit that referenced this issue Aug 1, 2016
Fix #1298 Release of persistence space for user managed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants