Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-2523

NPE in BDB Store

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Done
    • 5.1.6.FINAL
    • None
    • Loaders and Stores
    • None

    Description

      Currently org.infinispan.loaders.bdbje.BdbjeCacheStore#prepare does next things:
      1) Create transaction in currentTransaction
      2) Retrieve it from currentTransaction
      3) Remove all transactions from currentTransaction.

      This leads to race condition when one thread can do (3) between (1) and (2) in another thread. This produces:
      org.infinispan.loaders.CacheLoaderException: Problem preparing transaction
      at org.infinispan.loaders.bdbje.BdbjeCacheStore.convertToCacheLoaderException(BdbjeCacheStore.java:589)
      at org.infinispan.loaders.bdbje.BdbjeCacheStore.prepare(BdbjeCacheStore.java:315)
      at org.infinispan.loaders.bdbje.BdbjeCacheStore.prepare(BdbjeCacheStore.java:274)
      at org.infinispan.interceptors.CacheStoreInterceptor.prepareCacheLoader(CacheStoreInterceptor.java:289)
      at org.infinispan.interceptors.CacheStoreInterceptor.visitPrepareCommand(CacheStoreInterceptor.java:199)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130)
      at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:126)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.EntryWrappingInterceptor.visitPrepareCommand(EntryWrappingInterceptor.java:93)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.invokeNextAndCommitIf1Pc(AbstractTxLockingInterceptor.java:120)
      at org.infinispan.interceptors.locking.OptimisticLockingInterceptor.visitPrepareCommand(OptimisticLockingInterceptor.java:131)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.NotificationInterceptor.visitPrepareCommand(NotificationInterceptor.java:58)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.TxInterceptor.visitPrepareCommand(TxInterceptor.java:106)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.StateTransferLockInterceptor.handleWithRetries(StateTransferLockInterceptor.java:213)
      at org.infinispan.interceptors.StateTransferLockInterceptor.visitPrepareCommand(StateTransferLockInterceptor.java:85)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:130)
      at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:126)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:132)
      at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:91)
      at org.infinispan.commands.AbstractVisitor.visitPrepareCommand(AbstractVisitor.java:126)
      at org.infinispan.commands.tx.PrepareCommand.acceptVisitor(PrepareCommand.java:133)
      at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345)
      at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:140)
      at org.infinispan.transaction.TransactionCoordinator.prepare(TransactionCoordinator.java:122)
      at org.infinispan.transaction.xa.TransactionXaAdapter.commit(TransactionXaAdapter.java:120)
      at org.apache.geronimo.transaction.manager.TransactionImpl.commitResource(TransactionImpl.java:688)
      at org.apache.geronimo.transaction.manager.TransactionImpl.commit(TransactionImpl.java:304)
      at org.apache.geronimo.transaction.manager.TransactionManagerImpl.commit(TransactionManagerImpl.java:250)
      at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.6.0_24]
      at java.lang.reflect.Method.invoke(Method.java:616)[:1.6.0_24]
      at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.doInvoke(ServiceInvoker.java:58)[73:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.service.importer.support.internal.aop.ServiceInvoker.invoke(ServiceInvoker.java:62)[73:org.springframework.osgi.core:1.2.1]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invokeUnprivileged(ServiceTCCLInterceptor.java:56)[73:org.springframework.osgi.core:1.2.1]
      at org.springframework.osgi.service.util.internal.aop.ServiceTCCLInterceptor.invoke(ServiceTCCLInterceptor.java:39)[73:org.springframework.osgi.core:1.2.1]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.osgi.service.importer.support.LocalBundleContextAdvice.invoke(LocalBundleContextAdvice.java:59)[73:org.springframework.osgi.core:1.2.1]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)[71:org.springframework.aop:3.0.6.RELEASE]
      at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)[71:org.springframework.aop:3.0.6.RELEASE]
      at $Proxy57.commit(Unknown Source)[:]
      at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:1016)[808:org.infinispan.core:5.1.6.FINAL]
      at org.infinispan.CacheImpl.put(CacheImpl.java:702)[808:org.infinispan.core:5.1.6.FINAL]
      at org.infinispan.CacheImpl.put(CacheImpl.java:694)[808:org.infinispan.core:5.1.6.FINAL]
      at org.infinispan.CacheSupport.put(CacheSupport.java:53)[808:org.infinispan.core:5.1.6.FINAL]
      at com.ubs.ace.quickfix.store.InfinispanStore.updateNextTargetMsgSeqNum(InfinispanStore.java:89)[807:com.ubs.ace.quickfix-engine:1.0.0]
      at com.ubs.ace.quickfix.store.InfinispanStore.incrNextTargetMsgSeqNum(InfinispanStore.java:85)[807:com.ubs.ace.quickfix-engine:1.0.0]
      at quickfix.SessionState.incrNextTargetMsgSeqNum(SessionState.java:368)[811:org.apache.servicemix.bundles.quickfix:1.5.2.1]
      at quickfix.Session.next(Session.java:974)[811:org.apache.servicemix.bundles.quickfix:1.5.2.1]
      at quickfix.mina.SingleThreadedEventHandlingStrategy$SessionMessageEvent.processMessage(SingleThreadedEventHandlingStrategy.java:114)[811:org.apache.servicemix.bundles.quickfix:1.5.2.1]
      at quickfix.mina.SingleThreadedEventHandlingStrategy.block(SingleThreadedEventHandlingStrategy.java:77)[811:org.apache.servicemix.bundles.quickfix:1.5.2.1]
      at quickfix.mina.SingleThreadedEventHandlingStrategy$1.run(SingleThreadedEventHandlingStrategy.java:94)[811:org.apache.servicemix.bundles.quickfix:1.5.2.1]
      at java.lang.Thread.run(Thread.java:679)[:1.6.0_24]
      Caused by: java.lang.NullPointerException
      at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:909)[:1.6.0_24]
      at org.infinispan.loaders.bdbje.BdbjeCacheStore.prepare(BdbjeCacheStore.java:312)
      ... 73 more

      Attachments

        Activity

          People

            mircea.markus Mircea Markus (Inactive)
            tivv00_jira Vitalii Tymchyshyn (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: