Bug 1382273 - [GSS 6.6.x] NPE in CacheNotifierImpl by LIRS eviction listener
Summary: [GSS 6.6.x] NPE in CacheNotifierImpl by LIRS eviction listener
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: JBoss Data Grid 6
Classification: JBoss
Component: Infinispan
Version: 6.4.1
Hardware: All
OS: All
high
high
Target Milestone: DR1
: 6.6.2
Assignee: William Burns
QA Contact: Martin Gencur
URL:
Whiteboard:
Depends On:
Blocks: 1374440 1404373
TreeView+ depends on / blocked
 
Reported: 2016-10-06 08:25 UTC by Ted Jongseok Won
Modified: 2025-02-10 03:49 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
: 1404373 (view as bug list)
Environment:
Last Closed: 2025-02-10 03:49:19 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
reproducer (18.29 KB, application/zip)
2016-10-06 08:25 UTC, Ted Jongseok Won
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker ISPN-7080 0 Major Resolved NPE in CacheNotifierImpl by LIRS eviction listener 2019-09-04 01:47:43 UTC

Description Ted Jongseok Won 2016-10-06 08:25:22 UTC
Created attachment 1207840 [details]
reproducer

Description of problem:
The EvictionListenerNPETest unit test in the attachment fails and throws NPE in CacheNotifierImpl.notifyCacheEntriesEvicted method when trying to reinsert the first keys again.
It reproduces only with LIRS eviction strategy and eviction listener.
However, LRU and UNORDERED eviction strategies are working properly.
It makes impossible the use of eviction listeners with LIRS eviction strategy.

It's able to reproduce by:
- inserting 20 keys - values in a 10 sized cache ( keys from key-1 to key-20),
- and then reinsert the first 10 keys (key-1 to key-10)


How reproducible:
mvn -Dtest=org.infinispan.EvictionListenerNPETest#testEvictionListener test

Steps to Reproduce:
1. Download and unzip the reproducer attachement infinispan-eviction-npe.zip
2. cd infinispan-eviction-npe
3. Run "mvn -Dtest=org.infinispan.EvictionListenerNPETest#testEvictionListener test"

Actual results:
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.infinispan.EvictionListenerNPETest
2016-10-06 16:57:23,858 (main) [ERROR - org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:124)] ISPN000136: Execution error
java.lang.NullPointerException
	at org.infinispan.notifications.cachelistener.CacheNotifierImpl$1$1.getKey(CacheNotifierImpl.java:340)
	at org.infinispan.commons.util.InfinispanCollections.transformCollectionToMap(InfinispanCollections.java:242)
	at org.infinispan.notifications.cachelistener.CacheNotifierImpl.notifyCacheEntriesEvicted(CacheNotifierImpl.java:333)
	at org.infinispan.eviction.EvictionManagerImpl.onEntryEviction(EvictionManagerImpl.java:144)
	at org.infinispan.container.DefaultDataContainer$DefaultEvictionListener.onEntryEviction(DefaultDataContainer.java:257)
	at org.infinispan.commons.util.concurrent.jdk8backported.BoundedEquivalentConcurrentHashMapV8.notifyEvictionListener(BoundedEquivalentConcurrentHashMapV8.java:285)
	at org.infinispan.commons.util.concurrent.jdk8backported.BoundedEquivalentConcurrentHashMapV8.get(BoundedEquivalentConcurrentHashMapV8.java:2281)
	at org.infinispan.container.DefaultDataContainer.peek(DefaultDataContainer.java:141)
	at org.infinispan.container.DefaultDataContainer.get(DefaultDataContainer.java:146)
	at org.infinispan.container.EntryFactoryImpl.getFromContainer(EntryFactoryImpl.java:266)
	at org.infinispan.container.EntryFactoryImpl.wrapEntryForPut(EntryFactoryImpl.java:193)
	at org.infinispan.interceptors.EntryWrappingInterceptor.wrapEntryForPutIfNeeded(EntryWrappingInterceptor.java:173)
	at org.infinispan.interceptors.EntryWrappingInterceptor.visitPutKeyValueCommand(EntryWrappingInterceptor.java:167)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
	at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitPutKeyValueCommand(AbstractLockingInterceptor.java:48)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
	at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:112)
	at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:34)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
	at org.infinispan.interceptors.CacheMgmtInterceptor.updateStoreStatistics(CacheMgmtInterceptor.java:148)
	at org.infinispan.interceptors.CacheMgmtInterceptor.visitPutKeyValueCommand(CacheMgmtInterceptor.java:134)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:98)
	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:104)
	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:73)
	at org.infinispan.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:34)
	at org.infinispan.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:71)
	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:336)
	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1520)
	at org.infinispan.CacheImpl.putInternal(CacheImpl.java:998)
	at org.infinispan.CacheImpl.put(CacheImpl.java:990)
	at org.infinispan.CacheImpl.put(CacheImpl.java:983)
	at org.infinispan.CacheImpl.put(CacheImpl.java:250)
	at org.infinispan.EvictionListenerNPETest.testEvictionListener(EvictionListenerNPETest.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:242)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:137)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Tests in error: 
  testEvictionListener(org.infinispan.EvictionListenerNPETest)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0


Expected results: It should be passed.


Additional info: Same bug exists in infinispan upstream master. https://issues.jboss.org/browse/ISPN-7080

Comment 3 Red Hat Bugzilla 2025-02-10 03:49:19 UTC
This product has been discontinued or is no longer tracked in Red Hat Bugzilla.


Note You need to log in before you can comment on or make changes to this bug.