[infinispan-issues] [JBoss JIRA] (ISPN-8721) Clustered 2nd level cache sometimes throws NullPointerException when new node starts up
Tom Dearman (JIRA)
issues at jboss.org
Wed Jan 24 09:03:00 EST 2018
Tom Dearman created ISPN-8721:
---------------------------------
Summary: Clustered 2nd level cache sometimes throws NullPointerException when new node starts up
Key: ISPN-8721
URL: https://issues.jboss.org/browse/ISPN-8721
Project: Infinispan
Issue Type: Bug
Components: Hibernate Cache
Affects Versions: 9.1.4.Final
Environment: jvm 1.8
Reporter: Tom Dearman
Attachments: sample-app.cache.tar.gz
There is a race condition in PutFromLoadValidator as it registers itself in the component registry before it is fully initialised. You can reproduce this by running the contained app against h2 server db. First start this app with default port. Then start the app on port '8080' and make a few requests to '/add' to create data. After that send continuous requests to '/update' in order change data and trigger the cache:
for i in
{1..1000}
; do sleep 0.01; curl http://localhost:8080/update -X POST; done
Then start another instance of the app on port 8090:
java -jar test-app-0.0.1-SNAPSHOT.jar --server.port=8090
Most of the time one of the updates will fail and the logs will show the following:
2018-01-23 15:36:46 [main] DEBUG o.h.c.i.access.PutFromLoadValidator - Interceptor chain was: [org.infinispan.interceptors.InvocationContextInterceptor at 407a7f2a, org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor at 4ea5b703, org.infinispan.interceptors.EntryWrappingInterceptor at 2a7ed1f, org.infinispan.interceptors.InvalidationInterceptor at 3fa247d1, org.infinispan.interceptors.CallInterceptor at 2cb2fc20]
2018-01-23 15:36:46 [main] DEBUG o.h.c.i.access.PutFromLoadValidator - New interceptor chain is: [org.infinispan.interceptors.InvocationContextInterceptor at 407a7f2a, org.infinispan.interceptors.locking.NonTransactionalLockingInterceptor at 4ea5b703, org.hibernate.cache.infinispan.access.NonTxPutFromLoadInterceptor at 495ee280, org.infinispan.interceptors.EntryWrappingInterceptor at 2a7ed1f, org.hibernate.cache.infinispan.access.NonTxInvalidationInterceptor at 4fa1c212, org.infinispan.interceptors.CallInterceptor at 2cb2fc20]
2018-01-23 15:36:46 [main] TRACE o.i.manager.DefaultCacheManager - About to wire and start cache test.app.data.User-pending-puts
2018-01-23 15:36:46 [remote-thread--p2-t1] ERROR o.i.i.InvocationContextInterceptor - ISPN000136: Error executing command BeginInvalidationCommand, writing keys test.app.data.User#2
java.lang.NullPointerException: null
at org.hibernate.cache.infinispan.access.PutFromLoadValidator.beginInvalidatingWithPFER(PutFromLoadValidator.java:561)
at org.hibernate.cache.infinispan.access.PutFromLoadValidator.beginInvalidatingKey(PutFromLoadValidator.java:555)
at org.hibernate.cache.infinispan.access.NonTxPutFromLoadInterceptor.visitInvalidateCommand(NonTxPutFromLoadInterceptor.java:70)
at org.infinispan.commands.write.InvalidateCommand.acceptVisitor(InvalidateCommand.java:114)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at org.infinispan.interceptors.locking.AbstractLockingInterceptor.visitInvalidateCommand(AbstractLockingInterceptor.java:112)
at org.infinispan.commands.write.InvalidateCommand.acceptVisitor(InvalidateCommand.java:114)
at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:99)
at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:110)
at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:79)
at org.infinispan.commands.AbstractVisitor.visitInvalidateCommand(AbstractVisitor.java:127)
at org.infinispan.commands.write.InvalidateCommand.acceptVisitor(InvalidateCommand.java:114)
at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:335)
at org.infinispan.commands.remote.BaseRpcInvokingCommand.processVisitableCommand(BaseRpcInvokingCommand.java:43)
at org.infinispan.commands.remote.SingleRpcCommand.perform(SingleRpcCommand.java:51)
at org.infinispan.remoting.inboundhandler.BasePerCacheInboundInvocationHandler.invokePerform(BasePerCacheInboundInvocationHandler.java:92)
at org.infinispan.remoting.inboundhandler.BaseBlockingRunnable.run(BaseBlockingRunnable.java:34)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
2018-01-23 15:36:47 [main] TRACE o.i.manager.DefaultCacheManager - Closing latch for cache test.app.data.User-pending-puts
--
This message was sent by Atlassian JIRA
(v7.5.0#75005)
More information about the infinispan-issues
mailing list