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

Replication timeout if lock acquired before other node join

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Major
    • None
    • 4.1.0.CR2
    • Transactions
    • None
    • Hide

      Put the attached Test.java and config.xml both in a package called infinispan.

      • Run Test.java in process1.
      • When "Before lock" message shows, press enter to continue. The Lock acquired message will be shown.
      • Run Test.java in process2.
      • When "Before lock" message shows, press enter to continue. The Lock acquired message will not be shown since proces1 is holding the lock.
      • Press enter in process1. Will take some seconds, then Commit Successful will be shown.
      • In process2, instead of a Lock Acquired message as expected, the exception in the issue description is thrown.

      Note that if the following steps are used instead, the exception will not happen:

      • Run Test.java in process1 and wait for "Before lock" message, but do not press enter yet.
      • Run Test.java in process2 and wait for "Before lock" message, but do not press enter yet..
      • Press enter in process1. The Lock acquired message will be shown.
      • Press enter in process2 The Lock acquired message will not be shown since proces1 is holding the lock.
      • Press enter in process1. Commit Successful will be shown in process1 (instantly, without the delay of the scenario above) and Lock Acquired message will be shown in process2.
      • Press enter in process2. Commit Successful will be shown In process2.

      Note also that if cache.put is commented from Test.java, the error does not reproduce and everything works as expected.

      Show
      Put the attached Test.java and config.xml both in a package called infinispan. Run Test.java in process1. When "Before lock" message shows, press enter to continue. The Lock acquired message will be shown. Run Test.java in process2. When "Before lock" message shows, press enter to continue. The Lock acquired message will not be shown since proces1 is holding the lock. Press enter in process1. Will take some seconds, then Commit Successful will be shown. In process2, instead of a Lock Acquired message as expected, the exception in the issue description is thrown. Note that if the following steps are used instead, the exception will not happen: Run Test.java in process1 and wait for "Before lock" message, but do not press enter yet. Run Test.java in process2 and wait for "Before lock" message, but do not press enter yet.. Press enter in process1. The Lock acquired message will be shown. Press enter in process2 The Lock acquired message will not be shown since proces1 is holding the lock. Press enter in process1. Commit Successful will be shown in process1 (instantly, without the delay of the scenario above) and Lock Acquired message will be shown in process2. Press enter in process2. Commit Successful will be shown In process2. Note also that if cache.put is commented from Test.java, the error does not reproduce and everything works as expected.

    Description

      If a node acquires a lock and then a another node joins in and tries to acquire the same lock, a replication timeout exception occurs.
      This does not have to do with lock timeout, since a much higher lockAcquisitionTimeout was configured.

      This is the exception stack trace:
      14:25:28,218 [main] ERROR s.InvocationContextInterceptor - Execution error:
      org.infinispan.util.concurrent.TimeoutException: Replication timeout for myhostname-50939
      at org.infinispan.remoting.transport.jgroups.JGroupsTransport.invokeRemotely(JGroupsTransport.java:421)
      at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:100)
      at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:124)
      at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:229)
      at org.infinispan.remoting.rpc.RpcManagerImpl.invokeRemotely(RpcManagerImpl.java:216)
      at org.infinispan.remoting.rpc.RpcManagerImpl.broadcastRpcCommand(RpcManagerImpl.java:199)
      at org.infinispan.interceptors.base.BaseRpcInterceptor.visitLockControlCommand(BaseRpcInterceptor.java:59)
      at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:82)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      at org.infinispan.interceptors.LockingInterceptor.visitLockControlCommand(LockingInterceptor.java:149)
      at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:82)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      at org.infinispan.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:132)
      at org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:147)
      at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:82)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      at org.infinispan.interceptors.TxInterceptor.enlistReadAndInvokeNext(TxInterceptor.java:171)
      at org.infinispan.interceptors.TxInterceptor.visitLockControlCommand(TxInterceptor.java:115)
      at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:82)
      at org.infinispan.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:118)
      at org.infinispan.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:58)
      at org.infinispan.interceptors.InvocationContextInterceptor.handleDefault(InvocationContextInterceptor.java:39)
      at org.infinispan.commands.AbstractVisitor.visitLockControlCommand(AbstractVisitor.java:147)
      at org.infinispan.commands.control.LockControlCommand.acceptVisitor(LockControlCommand.java:82)
      at org.infinispan.interceptors.InterceptorChain.invoke(InterceptorChain.java:271)
      at org.infinispan.CacheDelegate.lock(CacheDelegate.java:296)
      at org.infinispan.CacheDelegate.lock(CacheDelegate.java:289)
      at infinispan.Test.main(Test.java:29)

      Attachments

        1. config.xml
          0.8 kB
        2. Test.java
          1 kB
        3. Test.java
          1 kB

        Activity

          People

            manik_jira Manik Surtani (Inactive)
            rgevaerd_jira Rodrigo Faria (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: