Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-5041

NPE during deadlock detection because cache isn't started on node

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.7
    • 2.0
    • cache
    • None

    Description

      NPE is possible during deadlock detection process in case when one of participating cache isn't started on node that initiates transaction:

      Exception in thread "sys-#66%transactions.TxDeadlockNpeClientTest1%" java.lang.NullPointerException
      	at org.apache.ignite.internal.processors.cache.transactions.IgniteTxKey.finishUnmarshal(IgniteTxKey.java:92)
      	at org.apache.ignite.internal.processors.cache.transactions.TxLocksResponse.finishUnmarshal(TxLocksResponse.java:190)
      	at org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$DeadlockDetectionListener.unmarshall(IgniteTxManager.java:2588)
      	at org.apache.ignite.internal.processors.cache.transactions.IgniteTxManager$DeadlockDetectionListener.onMessage(IgniteTxManager.java:2478)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.invokeListener(GridIoManager.java:1082)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:710)
      	at org.apache.ignite.internal.managers.communication.GridIoManager.access$1700(GridIoManager.java:102)
      	at org.apache.ignite.internal.managers.communication.GridIoManager$5.run(GridIoManager.java:673)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      Steps to reproduce:

      1. Start server node with two caches.
      2. Start two transactions on server node that involve both caches and lead to deadlock.
      3. Start client node and create only one cache
      4. Start transaction on client node that will try to update key that involved into deadlock

      As result transaction on client node will hang until deadlock detection timeout happens.

      The same result could be achived using node filters for caches.

      Workaround:

      Start all caches on node if possible.

      Another way is deadlock detection disabling using JVM parameter -DIGNITE_TX_DEADLOCK_DETECTION_MAX_ITERS=0

      Possible solution:

      Try to create CacheObjectContext without starting of the cache.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            agura Andrey N. Gura
            agura Andrey N. Gura
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment