This is an automated email from the ASF dual-hosted git repository.
mpetrov 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 03a96c25cb0 IGNITE-28348 Fixed NullPointerException while executing
putAllConflict/removeAllConflict requests during cache startup (#12943)
03a96c25cb0 is described below
commit 03a96c25cb0bb790c1892e978ba79861a1933f44
Author: Mikhail Petrov <[email protected]>
AuthorDate: Sun Mar 29 23:21:26 2026 +0300
IGNITE-28348 Fixed NullPointerException while executing
putAllConflict/removeAllConflict requests during cache startup (#12943)
---
.../client/cache/ClientCachePutAllConflictRequest.java | 2 +-
.../client/cache/ClientCacheRemoveAllConflictRequest.java | 2 +-
.../platform/client/cache/ClientCacheRequest.java | 14 ++++++++------
3 files changed, 10 insertions(+), 8 deletions(-)
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePutAllConflictRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePutAllConflictRequest.java
index b080f0b605f..08b24f37b8b 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePutAllConflictRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCachePutAllConflictRequest.java
@@ -72,7 +72,7 @@ public class ClientCachePutAllConflictRequest extends
ClientCacheDataRequest imp
/** {@inheritDoc} */
@Override public ClientResponse process(ClientConnectionContext ctx) {
try {
- cachex(ctx).putAllConflict(map);
+ internalCache(ctx).putAllConflict(map);
}
catch (IgniteCheckedException e) {
throw U.convertException(e);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRemoveAllConflictRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRemoveAllConflictRequest.java
index b3e7607e022..632c36b39e3 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRemoveAllConflictRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRemoveAllConflictRequest.java
@@ -61,7 +61,7 @@ public class ClientCacheRemoveAllConflictRequest extends
ClientCacheDataRequest
/** {@inheritDoc} */
@Override public ClientResponse process(ClientConnectionContext ctx) {
try {
- cachex(ctx).removeAllConflict(map);
+ internalCache(ctx).removeAllConflict(map);
}
catch (IgniteCheckedException e) {
throw U.convertException(e);
diff --git
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
index efb9252d568..8966eecedc8 100644
---
a/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
+++
b/modules/core/src/main/java/org/apache/ignite/internal/processors/platform/client/cache/ClientCacheRequest.java
@@ -21,6 +21,7 @@ import javax.cache.expiry.ExpiryPolicy;
import org.apache.ignite.IgniteCache;
import org.apache.ignite.binary.BinaryRawReader;
import org.apache.ignite.internal.processors.cache.DynamicCacheDescriptor;
+import org.apache.ignite.internal.processors.cache.IgniteCacheProxy;
import org.apache.ignite.internal.processors.cache.IgniteInternalCache;
import
org.apache.ignite.internal.processors.platform.cache.expiry.PlatformExpiryPolicy;
import
org.apache.ignite.internal.processors.platform.client.ClientConnectionContext;
@@ -83,10 +84,8 @@ public abstract class ClientCacheRequest extends
ClientRequest {
* @param ctx Kernal context.
* @return Cache.
*/
- protected IgniteInternalCache<Object, Object>
cachex(ClientConnectionContext ctx) {
- String cacheName = cacheDescriptor(ctx).cacheName();
-
- return ctx.kernalContext().grid().cachex(cacheName).keepBinary();
+ protected IgniteInternalCache<?, ?> internalCache(ClientConnectionContext
ctx) {
+ return ((IgniteCacheProxy<?, ?>)cache(ctx)).internalProxy();
}
/**
@@ -128,6 +127,10 @@ public abstract class ClientCacheRequest extends
ClientRequest {
String cacheName = cacheDesc.cacheName();
IgniteCache<Object, Object> cache =
ctx.kernalContext().grid().cache(cacheName);
+
+ if (cache == null)
+ throw new IgniteClientException(ClientStatus.CACHE_DOES_NOT_EXIST,
"Cache does not exist [cacheName= " + cacheName + "]");
+
if (withExpiryPolicy())
cache = cache.withExpiryPolicy(expiryPolicy);
@@ -155,8 +158,7 @@ public abstract class ClientCacheRequest extends
ClientRequest {
DynamicCacheDescriptor desc =
ctx.kernalContext().cache().cacheDescriptor(cacheId);
if (desc == null)
- throw new IgniteClientException(ClientStatus.CACHE_DOES_NOT_EXIST,
"Cache does not exist [cacheId= " +
- cacheId + "]", null);
+ throw new IgniteClientException(ClientStatus.CACHE_DOES_NOT_EXIST,
"Cache does not exist [cacheId= " + cacheId + "]");
return desc;
}