ignite-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ilya Kasnacheev (Jira)" <j...@apache.org>
Subject [jira] [Created] (IGNITE-12425) Deadlock on CacheStore.loadAll
Date Mon, 09 Dec 2019 12:13:00 GMT
Ilya Kasnacheev created IGNITE-12425:
----------------------------------------

             Summary: Deadlock on CacheStore.loadAll
                 Key: IGNITE-12425
                 URL: https://issues.apache.org/jira/browse/IGNITE-12425
             Project: Ignite
          Issue Type: Bug
          Components: cache
    Affects Versions: 2.7.6
            Reporter: Ilya Kasnacheev
         Attachments: ignite-dataload-deadlock.zip

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 compabable

{code}
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);
 
{code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Mime
View raw message