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

Deadlock on CacheStore.loadAll

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.7.6
    • None
    • cache
    • Release Notes Required

    Description

      Yes, we do have a deadlock in CacheStore.loadAll, as demonstrated by this reproducer.

      The obvious embarassing fix is to replace HashMap with TreeMap, which will of course not work if keys are not comparable

      diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
      index 3156d6d662d..3947800a908 100644
      --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
      +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheAdapter.java
      @@ -34,6 +34,7 @@ import java.util.List;
       import java.util.Map;
       import java.util.NoSuchElementException;
       import java.util.Set;
      +import java.util.TreeMap;
       import java.util.UUID;
       import java.util.concurrent.Callable;
       import java.util.concurrent.ExecutorService;
      @@ -2054,7 +2055,7 @@ public abstract class GridCacheAdapter<K, V> implements IgniteInternalCache<K, V
       
                                           if (res.value() == null) {
                                               if (misses == null)
      -                                            misses = new HashMap<>();
      +                                            misses = new TreeMap<>();
       
                                               misses.put(key, res);
       
      

      Attachments

        1. ignite-dataload-deadlock.zip
          30 kB
          Ilya Kasnacheev

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ilyak Ilya Kasnacheev
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: