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

av 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 830af532e4e IGNITE-19445 NPE during transaction recovery (#10728)
830af532e4e is described below

commit 830af532e4e9ba7fdebac3da3f985790d37ccd58
Author: Anton Vinogradov <a...@apache.org>
AuthorDate: Mon May 22 13:54:51 2023 +0300

    IGNITE-19445 NPE during transaction recovery (#10728)
---
 .../processors/cache/transactions/IgniteTxStateImpl.java      | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
index c3f39375a1d..3b8dce85ac3 100644
--- 
a/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
+++ 
b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/transactions/IgniteTxStateImpl.java
@@ -330,12 +330,19 @@ public class IgniteTxStateImpl extends 
IgniteTxLocalStateAdapter {
     }
 
     /** {@inheritDoc} */
-    @Override public boolean storeWriteThrough(GridCacheSharedContext cctx) {
+    @Override public boolean storeWriteThrough(GridCacheSharedContext sctx) {
         if (!activeCacheIds.isEmpty()) {
             for (int i = 0; i < activeCacheIds.size(); i++) {
                 int cacheId = activeCacheIds.get(i);
 
-                CacheStoreManager store = cctx.cacheContext(cacheId).store();
+                GridCacheContext<?, ?> ctx = sctx.cacheContext(cacheId);
+
+                // Ad-hoc solution to avoid the node crash.
+                // Proper solution is expected at 
https://issues.apache.org/jira/browse/IGNITE-19529
+                if (ctx == null) // Most likely, because of reading of an 
inconsitent state of a non-threadsafe collection.
+                    continue;
+
+                CacheStoreManager store = ctx.store();
 
                 if (store.configured() && store.isWriteThrough())
                     return true;

Reply via email to