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

New configuration API bug hiding a NPE in VersionedEntryWrappingInterceptor

    Details

      Description

      While doing ISPN-1367 and converting the internals to new configuration, I've found two bugs.

      Basically, there's a bug in the new-to-old configuration transformation (ISPN-1922) that makes FlagsEnabledTest pass when it shouldn't.

      To be precise, that test enables configuration such as:

      .versioning().enable().scheme(VersioningScheme.SIMPLE)

      But, in the InterceptorChainFactory, needsVersionAwareComponents returns false (configuration.isEnableVersioning() = false):

      boolean needsVersionAwareComponents = configuration.isTransactionalCache() && configuration.isWriteSkewCheck() &&
         configuration.getTransactionLockingMode() == LockingMode.OPTIMISTIC && configuration.isEnableVersioning();

      By changing the internals to the config, the configuration.isEnableVersioning() returns true and so FlagsEnabledTest.testWithFlagsSemantics fails with:

      2012-03-16 15:12:42,337 ERROR [InvocationContextInterceptor] (main) ISPN000136: Execution error
      java.lang.NullPointerException
      	at org.infinispan.interceptors.VersionedEntryWrappingInterceptor.commitContextEntry(VersionedEntryWrappingInterceptor.java:94)
      	at org.infinispan.interceptors.EntryWrappingInterceptor.commitEntryIfNeeded(EntryWrappingInterceptor.java:271)
      	at org.infinispan.interceptors.EntryWrappingInterceptor.commitContextEntries(EntryWrappingInterceptor.java:182)
      	at org.infinispan.interceptors.VersionedEntryWrappingInterceptor.visitCommitCommand(VersionedEntryWrappingInterceptor.java:87)
      	at org.infinispan.commands.tx.CommitCommand.acceptVisitor(CommitCommand.java:66)
      	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.visitCommitCommand(AbstractVisitor.java:121)
      	at org.infinispan.interceptors.locking.AbstractTxLockingInterceptor.visitCommitCommand(AbstractTxLockingInterceptor.java:105)
      	at org.infinispan.commands.tx.CommitCommand.acceptVisitor(CommitCommand.java:66)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      	at org.infinispan.interceptors.NotificationInterceptor.visitCommitCommand(NotificationInterceptor.java:65)
      	at org.infinispan.commands.tx.CommitCommand.acceptVisitor(CommitCommand.java:66)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      	at org.infinispan.interceptors.TxInterceptor.visitCommitCommand(TxInterceptor.java:120)
      	at org.infinispan.commands.tx.CommitCommand.acceptVisitor(CommitCommand.java:66)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      	at org.infinispan.interceptors.StateTransferLockInterceptor.handleWithRetries(StateTransferLockInterceptor.java:207)
      	at org.infinispan.interceptors.StateTransferLockInterceptor.visitCommitCommand(StateTransferLockInterceptor.java:120)
      	at org.infinispan.commands.tx.CommitCommand.acceptVisitor(CommitCommand.java:66)
      	at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:130)
      	at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:89)
      	at org.infinispan.commands.AbstractVisitor.visitCommitCommand(AbstractVisitor.java:121)
      	at org.infinispan.commands.tx.CommitCommand.acceptVisitor(CommitCommand.java:66)
      	at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:345)
      	at org.infinispan.transaction.TransactionCoordinator.commit(TransactionCoordinator.java:182)
      	at org.infinispan.transaction.xa.TransactionXaAdapter.commit(TransactionXaAdapter.java:125)
      	at com.arjuna.ats.internal.jta.resources.arjunacore.XAResourceRecord.topLevelOnePhaseCommit(XAResourceRecord.java:667)
      	at com.arjuna.ats.arjuna.coordinator.BasicAction.onePhaseCommit(BasicAction.java:2283)
      	at com.arjuna.ats.arjuna.coordinator.BasicAction.End(BasicAction.java:1466)
      	at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:98)
      	at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:164)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1165)
      	at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:117)
      	at org.infinispan.CacheImpl.executeCommandAndCommitIfNeeded(CacheImpl.java:955)
      	at org.infinispan.CacheImpl.put(CacheImpl.java:659)
      	at org.infinispan.DecoratedCache.put(DecoratedCache.java:319)
      	at org.infinispan.api.flags.FlagsEnabledTest.testWithFlagsSemantics(FlagsEnabledTest.java:83)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      	at java.lang.reflect.Method.invoke(Method.java:597)

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  galder.zamarreno Galder Zamarreño
                  Reporter:
                  galder.zamarreno Galder Zamarreño
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  1 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: