You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sk...@apache.org on 2021/02/15 19:07:39 UTC

[ignite] branch master updated: IGNITE-14078 Fixed an issue that caused a deadlock when user cache was created in parallel with TTL worker was in progress. Fixes #8718

This is an automated email from the ASF dual-hosted git repository.

sk0x50 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new d5048ba  IGNITE-14078 Fixed an issue that caused a deadlock when user cache was created in parallel with TTL worker was in progress. Fixes #8718
d5048ba is described below

commit d5048ba1e37d8f2bf4d90780cdaa8604ac3bbe32
Author: Mirza Aliev <al...@gmail.com>
AuthorDate: Mon Feb 15 22:06:49 2021 +0300

    IGNITE-14078 Fixed an issue that caused a deadlock when user cache was created in parallel with TTL worker was in progress. Fixes #8718
    
    Signed-off-by: Slava Koptilin <sl...@gmail.com>
---
 .../cache/GridCacheSharedTtlCleanupManager.java    | 23 ++++++++++++++--------
 1 file changed, 15 insertions(+), 8 deletions(-)

diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedTtlCleanupManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedTtlCleanupManager.java
index 99de8ad..da2b793 100644
--- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedTtlCleanupManager.java
+++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheSharedTtlCleanupManager.java
@@ -184,14 +184,21 @@ public class GridCacheSharedTtlCleanupManager extends GridCacheSharedManagerAdap
 
                         Integer processedCacheID = mgr.getKey();
 
-                        // Need to be sure that the cache to be processed will not be unregistered and,
-                        // therefore, stopped during the process of expiration is in progress.
-                        mgrs.computeIfPresent(processedCacheID, (id, m) -> {
-                            if (m.expire(CLEANUP_WORKER_ENTRIES_PROCESS_LIMIT))
-                                expiredRemains.set(true);
-
-                            return m;
-                        });
+                        cctx.database().checkpointReadLock();
+
+                        try {
+                            // Need to be sure that the cache to be processed will not be unregistered and,
+                            // therefore, stopped during the process of expiration is in progress.
+                            mgrs.computeIfPresent(processedCacheID, (id, m) -> {
+                                if (m.expire(CLEANUP_WORKER_ENTRIES_PROCESS_LIMIT))
+                                    expiredRemains.set(true);
+
+                                return m;
+                            });
+                        }
+                        finally {
+                            cctx.database().checkpointReadUnlock();
+                        }
 
                         if (isCancelled())
                             return;