IGNITE-7972 Fixed NPE in TTL manager on unwindEvicts. - Fixes #3810. Signed-off-by: dpavlov <dpav...@apache.org>
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/737933e6 Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/737933e6 Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/737933e6 Branch: refs/heads/ignite-7708 Commit: 737933e6db33f7f74005f3783d81d4bd7331c21d Parents: baaef27 Author: Andrey V. Mashenkov <andrey.mashen...@gmail.com> Authored: Mon Apr 16 20:43:36 2018 +0300 Committer: dpavlov <dpav...@apache.org> Committed: Mon Apr 16 20:48:28 2018 +0300 ---------------------------------------------------------------------- .../internal/processors/cache/GridCacheTtlManager.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ignite/blob/737933e6/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java ---------------------------------------------------------------------- diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java index b6f54a1..d36485a 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheTtlManager.java @@ -40,8 +40,8 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter { /** Entries pending removal. */ private GridConcurrentSkipListSetEx pendingEntries; - /** */ - private boolean eagerTtlEnabled; + /** See {@link CacheConfiguration#isEagerTtl()}. */ + private volatile boolean eagerTtlEnabled; /** */ private GridCacheContext dhtCtx; @@ -166,6 +166,12 @@ public class GridCacheTtlManager extends GridCacheManagerAdapter { * @return {@code True} if unprocessed expired entries remains. */ public boolean expire(int amount) { + // TTL manager is not initialized or eagerTtl disabled for cache. + if (!eagerTtlEnabled) + return false; + + assert cctx != null; + long now = U.currentTimeMillis(); try {