Skip to content

NullPointerException in disk store under high load on clear() #2742

@rschuetz

Description

@rschuetz

We're currently still using EhCache2 (2.10.6) that deadlocks under high load when removeAll() gets called (SSCCE can be provided if needed). I ran the same test against EhCache3 (3.8.1) in order to check whether we can upgrade. Fortunately, there seems to be no deadlock anymore but there are occasionally NPEs:

java.lang.NullPointerException
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.lambda$flush$16(AbstractOffHeapStore.java:863)
    at org.ehcache.impl.internal.store.disk.EhcachePersistentConcurrentOffHeapClockCache.lambda$computeIfPinned$3(EhcachePersistentConcurrentOffHeapClockCache.java:213)
    at org.ehcache.shadow.org.terracotta.offheapstore.OffHeapHashMap.computeIfPresentWithMetadata(OffHeapHashMap.java:2108)
    at org.ehcache.shadow.org.terracotta.offheapstore.AbstractLockedOffHeapHashMap.computeIfPresentWithMetadata(AbstractLockedOffHeapHashMap.java:542)
    at org.ehcache.shadow.org.terracotta.offheapstore.concurrent.AbstractConcurrentOffHeapMap.computeIfPresentWithMetadata(AbstractConcurrentOffHeapMap.java:781)
    at org.ehcache.impl.internal.store.disk.EhcachePersistentConcurrentOffHeapClockCache.computeIfPinned(EhcachePersistentConcurrentOffHeapClockCache.java:210)
    at org.ehcache.impl.internal.store.offheap.AbstractOffHeapStore.flush(AbstractOffHeapStore.java:862)
    at org.ehcache.impl.internal.store.tiering.TieredStore$NoopCachingTier.getOrComputeIfAbsent(TieredStore.java:552)
    at org.ehcache.impl.internal.store.tiering.TieredStore.get(TieredStore.java:87)
    at org.ehcache.core.Ehcache.doGet(Ehcache.java:90)
    at org.ehcache.core.EhcacheBase.get(EhcacheBase.java:127)
    at TestDeadlockLowLevelEhCache3Minimal$ThreadRunner$GetThread.run(TestDeadlockLowLevelEhCache3Minimal.java:151)

A SSCCE to reproduce the test is attached (no further dependencies needed): TestDeadlockLowLevelEhCache3Minimal.zip

OS is Ubuntu 18.04.3, JDK version is 1.8.0_191.

The issue has bee posted to the ehcache-user group before as requested (https://groups.google.com/forum/#!category-topic/ehcache-users/ehcache-core/cfOAD366ZMo)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions