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

[Test] Synchronous evicts may cause a deadlock

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None

    Description

      See gg-5276

      [20:22:49,442][INFO ][start-stop-thread-1][GridDataLoaderProcessorSelfTest] >>>>>>> Started node: 2ed6cd2e-f581-4831-81e5-7e8063e020c4
      java.lang.Exception: <20:22:49,911><DEBUG><gridgain-#1467%dataload.GridDataLoaderProcessorSelfTest4%> >>>>>>>>>>>>>>>>>>>
      	at org.gridgain.grid.util.GridUtils.dumpStack(GridUtils.java:661)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl.wLock(GridDhtPartitionTopologyImpl.java:179)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl.onEvicted(GridDhtPartitionTopologyImpl.java:1105)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.preloader.GridDhtPreloader.onPartitionEvicted(GridDhtPreloader.java:475)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.GridDhtLocalPartition.tryEvict(GridDhtLocalPartition.java:393)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.GridDhtLocalPartition.onRemoved(GridDhtLocalPartition.java:188)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.GridDhtPartitionTopologyImpl.onRemoved(GridDhtPartitionTopologyImpl.java:567)
      	at org.gridgain.grid.kernal.processors.cache.distributed.dht.GridDhtCacheEntry.onMarkedObsolete(GridDhtCacheEntry.java:97)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheMapEntry.evictInternal(GridCacheMapEntry.java:2187)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager.evict0(GridCacheEvictionManager.java:693)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager.access$2200(GridCacheEvictionManager.java:49)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager$EvictionFuture.prepare0(GridCacheEvictionManager.java:1678)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager$EvictionFuture.prepare(GridCacheEvictionManager.java:1591)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager.addToCurrentFuture(GridCacheEvictionManager.java:1052)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager.checkEvictionQueue(GridCacheEvictionManager.java:1008)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheEvictionManager.unwind(GridCacheEvictionManager.java:1278)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheUtils.unwindEvicts(GridCacheUtils.java:1402)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheIoManager.processUnordered(GridCacheIoManager.java:210)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheIoManager.access$500(GridCacheIoManager.java:35)
      	at org.gridgain.grid.kernal.processors.cache.GridCacheIoManager$1.onMessage(GridCacheIoManager.java:113)
      	at org.gridgain.grid.kernal.managers.communication.GridIoManager$GridFilteredMessageListener.onMessage(GridIoManager.java:1612)
      	at org.gridgain.grid.kernal.managers.communication.GridIoManager.processRegularMessage0(GridIoManager.java:675)
      	at org.gridgain.grid.kernal.managers.communication.GridIoManager.access$1900(GridIoManager.java:50)
      	at org.gridgain.grid.kernal.managers.communication.GridIoManager$6.body(GridIoManager.java:636)
      	at org.gridgain.grid.util.worker.GridWorker.run(GridWorker.java:139)
      	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:722)
      

      To debug this, I have added a check before write lock acquisition:

          private void wLock() {
              int cnt0 = cnt.get();
      
              if (cnt0 > 0)
                  U.dumpStack(">>>>>>>>>>>>>>>>>>>");
      
              lock.writeLock().lock();
          }
      

      cnt here is a thread local that holds count of read locks hold by current thread.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ashutak Artem Shutak
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: