From d873162b50aee32f5597f73d085cdcce50b9f2b2 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Wed, 13 Jul 2022 13:37:48 +0530 Subject: [PATCH 01/12] issue-2887 : Auto clear invaild cache entry --- .../org/ehcache/impl/internal/store/tiering/TieredStore.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java index c2b3c0bbe2..9efb55d47c 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java @@ -27,6 +27,7 @@ import org.ehcache.core.spi.store.events.StoreEventSource; import org.ehcache.core.spi.store.tiering.AuthoritativeTier; import org.ehcache.core.spi.store.tiering.CachingTier; +import org.ehcache.spi.serialization.SerializerException; import org.ehcache.spi.service.OptionalServiceDependencies; import org.ehcache.spi.service.Service; import org.ehcache.spi.service.ServiceConfiguration; @@ -383,6 +384,8 @@ private ValueHolder handleStoreAccessException(StoreAccessException ce) throw Throwable cause = ce.getCause(); if (cause instanceof StorePassThroughException) { throw (StoreAccessException) cause.getCause(); + }if(cause instanceof SerializerException){ + throw new StoreAccessException("SerializerException wrapped in StoreAccessException", cause); } if (cause instanceof Error) { throw (Error) cause; From 2f88420907cf20c4f11e90797bb16a38c20b6d4e Mon Sep 17 00:00:00 2001 From: Nishchay Date: Thu, 14 Jul 2022 18:44:35 +0530 Subject: [PATCH 02/12] issue-2887 : adding junit --- .../store/tiering/TieredStoreTest.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java index 151d5d72d4..c811977474 100644 --- a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java +++ b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java @@ -32,6 +32,7 @@ import org.ehcache.core.spi.store.tiering.CachingTier; import org.ehcache.impl.internal.store.heap.OnHeapStore; import org.ehcache.impl.internal.store.offheap.OffHeapStore; +import org.ehcache.spi.serialization.SerializerException; import org.ehcache.spi.service.Service; import org.ehcache.spi.service.ServiceProvider; import org.hamcrest.Matchers; @@ -156,6 +157,24 @@ public void testGetThrowsRuntimeException() throws Exception { } } + @Test + @SuppressWarnings("unchecked") + public void testGetThrowsSerializerException() throws Exception { + SerializerException serializerException = new SerializerException(); + StoreAccessException error = new StoreAccessException("SerializerException wrapped in StoreAccessException", serializerException); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(error); + + TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); + + try { + tieredStore.get(1); + fail("We should get an Error"); + } catch (StoreAccessException e) { + assertSame(serializerException, e.getCause()); + assertEquals("SerializerException wrapped in StoreAccessException", e.getMessage()); + } + } + @Test @SuppressWarnings("unchecked") public void testGetThrowsError() throws Exception { @@ -417,6 +436,23 @@ public void testComputeIfAbsentThrowsError() throws Exception { } } + @Test + @SuppressWarnings("unchecked") + public void testComputeIfAbsentThrowsRuntimeException() throws Exception { + + RuntimeException error = new RuntimeException(); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessException(error)); + + TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); + + try { + tieredStore.computeIfAbsent(1, n -> null); + fail("We should get an Error"); + } catch (RuntimeException e) { + assertSame(error, e); + } + } + @Test @SuppressWarnings("unchecked") public void testBulkCompute2Args() throws Exception { From f9c376a7d8df9240eed41941fa6cf1646abbbe03 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Mon, 22 Aug 2022 14:03:38 +0530 Subject: [PATCH 03/12] issue-2887 : adding new exception class to handle checked exception --- .../StoreAccessRuntimeException.java | 69 +++++++++++++++++++ .../internal/store/tiering/TieredStore.java | 21 +++--- 2 files changed, 79 insertions(+), 11 deletions(-) create mode 100644 ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java diff --git a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java new file mode 100644 index 0000000000..43111327ef --- /dev/null +++ b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java @@ -0,0 +1,69 @@ +/* + * Copyright Terracotta, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.ehcache.spi.resilience; + +/** + * A wrapper Runtime exception used when don't want to handle the checkedException an internal operation fails on a {@link org.ehcache.Cache}. + * + * @author nnares + */ +public class StoreAccessRuntimeException extends RuntimeException { + + private static final long serialVersionUID = 1L; + + /** + * Creates a new exception wrapping the {@link Throwable cause} passed in. + * + * @param cause the cause of this exception + */ + public StoreAccessRuntimeException(Throwable cause) { + super(cause); + } + + /** + * Creates a new exception wrapping the {@link Throwable cause} passed in and with the provided message. + * + * @param message information about the exception + * @param cause the cause of this exception + */ + public StoreAccessRuntimeException(String message, Throwable cause) { + super(message, cause); + } + + /** + * Creates a new exception with the provided message. + * + * @param message information about the exception + */ + public StoreAccessRuntimeException(String message) { + super(message); + } + + public static StoreAccessException handleRuntimeException(Exception re) { + if(re instanceof StoreAccessRuntimeException) { + Throwable cause = re.getCause(); + if(cause instanceof RuntimeException) { + throw (RuntimeException) cause; + } else { + return new StoreAccessException(cause); + } + } else { + return new StoreAccessException(re); + } + } + +} diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java index 9efb55d47c..b3ccf31a91 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java @@ -27,7 +27,7 @@ import org.ehcache.core.spi.store.events.StoreEventSource; import org.ehcache.core.spi.store.tiering.AuthoritativeTier; import org.ehcache.core.spi.store.tiering.CachingTier; -import org.ehcache.spi.serialization.SerializerException; +import org.ehcache.spi.resilience.StoreAccessRuntimeException; import org.ehcache.spi.service.OptionalServiceDependencies; import org.ehcache.spi.service.Service; import org.ehcache.spi.service.ServiceConfiguration; @@ -50,6 +50,8 @@ import java.util.function.Function; import java.util.function.Supplier; +import static org.ehcache.spi.resilience.StoreAccessRuntimeException.handleRuntimeException; + /** * A {@link Store} implementation supporting a tiered caching model. */ @@ -90,11 +92,11 @@ public ValueHolder get(final K key) throws StoreAccessException { try { return authoritativeTier.getAndFault(keyParam); } catch (StoreAccessException cae) { - throw new StorePassThroughException(cae); + throw new StoreAccessRuntimeException(cae); } }); - } catch (StoreAccessException ce) { - return handleStoreAccessException(ce); + } catch (RuntimeException re) { + throw handleRuntimeException(re); } } @@ -326,11 +328,11 @@ public ValueHolder computeIfAbsent(final K key, final Function handleStoreAccessException(StoreAccessException ce) throw Throwable cause = ce.getCause(); if (cause instanceof StorePassThroughException) { throw (StoreAccessException) cause.getCause(); - }if(cause instanceof SerializerException){ - throw new StoreAccessException("SerializerException wrapped in StoreAccessException", cause); - } - if (cause instanceof Error) { + }if (cause instanceof Error) { throw (Error) cause; } if (cause instanceof RuntimeException) { From 4c482bf82278b6166a948e41cb7a7bf33bf95125 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Mon, 22 Aug 2022 15:47:17 +0530 Subject: [PATCH 04/12] issue-2887 : fixing junit break --- .../ehcache/internal/store/StoreSPITest.java | 2 ++ .../store/tiering/TieredStoreTest.java | 24 +++++++++---------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java index ed60355ef7..dc45ed1611 100644 --- a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java +++ b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java @@ -16,6 +16,7 @@ package org.ehcache.internal.store; +import org.junit.Ignore; import org.junit.Test; /** @@ -32,6 +33,7 @@ public void testGetAndCompute() throws Exception { } @Test + @Ignore("TieredStoreSPITest#testComputeIfAbsent, TieredStoreWith3TiersSPITest#testComputeIfAbsent" ) public void testComputeIfAbsent() throws Exception { StoreComputeIfAbsentTest testSuite = new StoreComputeIfAbsentTest<>(getStoreFactory()); testSuite.runTestSuite().reportAndThrow(); diff --git a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java index c811977474..d3dfe99c73 100644 --- a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java +++ b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java @@ -32,6 +32,7 @@ import org.ehcache.core.spi.store.tiering.CachingTier; import org.ehcache.impl.internal.store.heap.OnHeapStore; import org.ehcache.impl.internal.store.offheap.OffHeapStore; +import org.ehcache.spi.resilience.StoreAccessRuntimeException; import org.ehcache.spi.serialization.SerializerException; import org.ehcache.spi.service.Service; import org.ehcache.spi.service.ServiceProvider; @@ -145,7 +146,7 @@ public void testGetMisses() throws Exception { @SuppressWarnings("unchecked") public void testGetThrowsRuntimeException() throws Exception { RuntimeException error = new RuntimeException(); - when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessException(error)); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); @@ -186,8 +187,8 @@ public void testGetThrowsError() throws Exception { try { tieredStore.get(1); fail("We should get an Error"); - } catch (Error e) { - assertSame(error, e); + } catch (Exception e) { + assertSame(error, e.getCause()); } } @@ -195,24 +196,23 @@ public void testGetThrowsError() throws Exception { @SuppressWarnings("unchecked") public void testGetThrowsException() throws Exception { Exception error = new Exception(); - when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessException(error)); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); try { tieredStore.get(1); fail("We should get an Error"); - } catch (RuntimeException e) { + } catch (Exception e) { assertSame(error, e.getCause()); - assertEquals("Unexpected checked exception wrapped in StoreAccessException", e.getMessage()); } } @Test @SuppressWarnings("unchecked") - public void testGetThrowsPassthrough() throws Exception { + public void testGetThrowsStoreAccessRuntime() throws Exception { StoreAccessException error = new StoreAccessException("inner"); - when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessException(new StorePassThroughException(error))); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); @@ -220,7 +220,7 @@ public void testGetThrowsPassthrough() throws Exception { tieredStore.get(1); fail("We should get an Error"); } catch (StoreAccessException e) { - assertSame(error, e); + assertSame(error, e.getCause()); } } @@ -431,8 +431,8 @@ public void testComputeIfAbsentThrowsError() throws Exception { try { tieredStore.computeIfAbsent(1, n -> null); fail("We should get an Error"); - } catch (Error e) { - assertSame(error, e); + } catch (Exception e) { + assertSame(error, e.getCause()); } } @@ -441,7 +441,7 @@ public void testComputeIfAbsentThrowsError() throws Exception { public void testComputeIfAbsentThrowsRuntimeException() throws Exception { RuntimeException error = new RuntimeException(); - when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessException(error)); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); From cb7d91c6ca33ead39c7fd3c1653246b82b4076bb Mon Sep 17 00:00:00 2001 From: Nishchay Date: Mon, 5 Sep 2022 19:44:34 +0530 Subject: [PATCH 05/12] issue-2887 : Fix for multi-threaded env --- .../ehcache/impl/internal/store/heap/OnHeapStore.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java index 1bfee26159..d33e3eb045 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java @@ -731,12 +731,21 @@ public ValueHolder getOrComputeIfAbsent(K key, Function> so getOrComputeIfAbsentObserver.end(CachingTierOperationOutcomes.GetOrComputeIfAbsentOutcome.HIT); // Return the value that we found in the cache (by getting the fault or just returning the plain value depending on what we found) - return getValue(cachedValue); + return getIfValidValue(cachedValue); } catch (RuntimeException re) { throw handleException(re); } } + private ValueHolder getIfValidValue(ValueHolder cachedValue) throws StoreAccessException { + try { + cachedValue.get(); + } catch (Throwable t) { + throw new StoreAccessException(t); + } + return cachedValue; + } + @Override public ValueHolder getOrDefault(K key, Function> source) throws StoreAccessException { try { From 7883215f6a326a08d655a5933e2039a032e1a1bd Mon Sep 17 00:00:00 2001 From: Nishchay Date: Mon, 12 Sep 2022 09:02:09 +0530 Subject: [PATCH 06/12] issue-2887 : updating fault completion logic --- .../StoreAccessRuntimeException.java | 14 ++-- .../impl/internal/store/heap/OnHeapStore.java | 79 +++++++------------ .../internal/store/tiering/TieredStore.java | 41 ++++------ 3 files changed, 51 insertions(+), 83 deletions(-) diff --git a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java index 43111327ef..b4a7eb4808 100644 --- a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java +++ b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java @@ -16,6 +16,8 @@ package org.ehcache.spi.resilience; +import java.util.concurrent.CompletionException; + /** * A wrapper Runtime exception used when don't want to handle the checkedException an internal operation fails on a {@link org.ehcache.Cache}. * @@ -53,17 +55,15 @@ public StoreAccessRuntimeException(String message) { super(message); } - public static StoreAccessException handleRuntimeException(Exception re) { - if(re instanceof StoreAccessRuntimeException) { + public static StoreAccessException handleRuntimeException(RuntimeException re) { + + if (re instanceof StoreAccessRuntimeException || re instanceof CompletionException) { Throwable cause = re.getCause(); - if(cause instanceof RuntimeException) { - throw (RuntimeException) cause; - } else { + if (cause instanceof RuntimeException) { return new StoreAccessException(cause); } - } else { - return new StoreAccessException(re); } + return new StoreAccessException(re); } } diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java index d33e3eb045..b682f9776c 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java @@ -89,6 +89,8 @@ import java.util.Objects; import java.util.Random; import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiFunction; @@ -99,6 +101,7 @@ import static org.ehcache.config.Eviction.noAdvice; import static org.ehcache.core.config.ExpiryUtils.isExpiryDurationInfinite; import static org.ehcache.core.exceptions.StorePassThroughException.handleException; +import static org.ehcache.spi.resilience.StoreAccessRuntimeException.handleRuntimeException; /** * {@link Store} and {@link HigherCachingTier} implementation for on heap. @@ -705,7 +708,9 @@ public ValueHolder getOrComputeIfAbsent(K key, Function> so cachedValue = backEnd.putIfAbsent(key, fault); if (cachedValue == null) { - return resolveFault(key, backEnd, now, fault); + ValueHolder valueHolder = resolveFault(key, backEnd, now, fault); + fault.complete(valueHolder); + return valueHolder; } } @@ -720,7 +725,9 @@ public ValueHolder getOrComputeIfAbsent(K key, Function> so cachedValue = backEnd.putIfAbsent(key, fault); if (cachedValue == null) { - return resolveFault(key, backEnd, now, fault); + ValueHolder valueHolder = resolveFault(key, backEnd, now, fault); + fault.complete(valueHolder); + return valueHolder; } } else { @@ -731,19 +738,10 @@ public ValueHolder getOrComputeIfAbsent(K key, Function> so getOrComputeIfAbsentObserver.end(CachingTierOperationOutcomes.GetOrComputeIfAbsentOutcome.HIT); // Return the value that we found in the cache (by getting the fault or just returning the plain value depending on what we found) - return getIfValidValue(cachedValue); + return getValue(cachedValue); } catch (RuntimeException re) { - throw handleException(re); - } - } - - private ValueHolder getIfValidValue(ValueHolder cachedValue) throws StoreAccessException { - try { - cachedValue.get(); - } catch (Throwable t) { - throw new StoreAccessException(t); + throw handleRuntimeException(re); } - return cachedValue; } @Override @@ -775,7 +773,7 @@ public ValueHolder getOrDefault(K key, Function> source) th private ValueHolder resolveFault(K key, Backend backEnd, long now, Fault fault) throws StoreAccessException { try { - ValueHolder value = fault.getValueHolder(); + ValueHolder value = fault.retrieveValueHolder(); OnHeapValueHolder newValue; if(value != null) { newValue = importValueFromLowerTier(key, value, now, backEnd, fault); @@ -821,6 +819,7 @@ private ValueHolder resolveFault(K key, Backend backEnd, long now, Faul return newValue; } catch (Throwable e) { + fault.fail(e); backEnd.remove(key, fault); throw new StoreAccessException(e); } @@ -1003,35 +1002,24 @@ private static class Fault extends OnHeapValueHolder { @IgnoreSizeOf private final Supplier> source; - private ValueHolder value; - private Throwable throwable; - private boolean complete; + private CompletableFuture> valueFuture; public Fault(Supplier> source) { super(FAULT_ID, 0, true); this.source = source; + this.valueFuture = new CompletableFuture<>(); + } + + private ValueHolder retrieveValueHolder(){ + return source.get(); } private void complete(ValueHolder value) { - synchronized (this) { - this.value = value; - this.complete = true; - notifyAll(); - } + valueFuture.complete(value); } private ValueHolder getValueHolder() { - synchronized (this) { - if (!complete) { - try { - complete(source.get()); - } catch (Throwable e) { - fail(e); - } - } - } - - return throwOrReturn(); + return valueFuture.join(); } @Override @@ -1039,23 +1027,8 @@ public long getId() { throw new UnsupportedOperationException("You should NOT call that?!"); } - private ValueHolder throwOrReturn() { - if (throwable != null) { - if (throwable instanceof RuntimeException) { - throw (RuntimeException) throwable; - } - throw new RuntimeException("Faulting from repository failed", throwable); - } - return value; - } - private void fail(Throwable t) { - synchronized (this) { - this.throwable = t; - this.complete = true; - notifyAll(); - } - throwOrReturn(); + valueFuture.completeExceptionally(t); } @Override @@ -1110,7 +1083,13 @@ public long size() { @Override public String toString() { - return "[Fault : " + (complete ? (throwable == null ? String.valueOf(value) : throwable.getMessage()) : "???") + "]"; + String valueOrException; + try { + valueOrException = valueFuture.get().toString(); + } catch (InterruptedException | ExecutionException e) { + valueOrException = e.toString(); + } + return "[Fault : " + valueOrException + "]"; } @Override diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java index b3ccf31a91..af035127b4 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java @@ -87,17 +87,13 @@ public void invalidateAllWithHash(long hash) throws StoreAccessException { @Override public ValueHolder get(final K key) throws StoreAccessException { - try { - return cachingTier().getOrComputeIfAbsent(key, keyParam -> { - try { - return authoritativeTier.getAndFault(keyParam); - } catch (StoreAccessException cae) { - throw new StoreAccessRuntimeException(cae); - } - }); - } catch (RuntimeException re) { - throw handleRuntimeException(re); - } + return cachingTier().getOrComputeIfAbsent(key, keyParam -> { + try { + return authoritativeTier.getAndFault(keyParam); + } catch (StoreAccessException cae) { + throw new StorePassThroughException(cae); + } + }); } @Override @@ -323,17 +319,13 @@ public ValueHolder computeAndGet(final K key, final BiFunction computeIfAbsent(final K key, final Function mappingFunction) throws StoreAccessException { - try { - return cachingTier().getOrComputeIfAbsent(key, keyParam -> { - try { - return authoritativeTier.computeIfAbsentAndFault(keyParam, mappingFunction); - } catch (StoreAccessException cae) { - throw new StoreAccessRuntimeException(cae); - } - }); - } catch (RuntimeException re) { - throw handleRuntimeException(re); - } + return cachingTier().getOrComputeIfAbsent(key, keyParam -> { + try { + return authoritativeTier.computeIfAbsentAndFault(keyParam, mappingFunction); + } catch (StoreAccessException cae) { + throw new StoreAccessRuntimeException(cae); + } + }); } @Override @@ -389,10 +381,7 @@ private ValueHolder handleStoreAccessException(StoreAccessException ce) throw }if (cause instanceof Error) { throw (Error) cause; } - if (cause instanceof RuntimeException) { - throw (RuntimeException) cause; - } - throw new RuntimeException("Unexpected checked exception wrapped in StoreAccessException", cause); + throw ce; } @ServiceDependencies({CachingTier.Provider.class, AuthoritativeTier.Provider.class}) From dcd2117d39e607a091ade8ba183465bf0cfff01b Mon Sep 17 00:00:00 2001 From: Nishchay Date: Mon, 12 Sep 2022 13:13:55 +0530 Subject: [PATCH 07/12] issue-2887 : fixing junit break --- .../impl/internal/store/tiering/TieredStoreTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java index d3dfe99c73..b0105e0a32 100644 --- a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java +++ b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java @@ -154,7 +154,7 @@ public void testGetThrowsRuntimeException() throws Exception { tieredStore.get(1); fail("We should get an Error"); } catch (RuntimeException e) { - assertSame(error, e); + assertSame(error, e.getCause()); } } @@ -219,7 +219,7 @@ public void testGetThrowsStoreAccessRuntime() throws Exception { try { tieredStore.get(1); fail("We should get an Error"); - } catch (StoreAccessException e) { + } catch (StoreAccessRuntimeException e) { assertSame(error, e.getCause()); } } @@ -449,7 +449,7 @@ public void testComputeIfAbsentThrowsRuntimeException() throws Exception { tieredStore.computeIfAbsent(1, n -> null); fail("We should get an Error"); } catch (RuntimeException e) { - assertSame(error, e); + assertSame(error, e.getCause()); } } From ab8c8eda98c2bca3837551baabf9c95c14ef5a1b Mon Sep 17 00:00:00 2001 From: Nishchay Date: Tue, 13 Sep 2022 18:00:51 +0530 Subject: [PATCH 08/12] issue-2887 : updating java doc --- .../StoreAccessRuntimeException.java | 9 +++++++- .../impl/internal/store/heap/OnHeapStore.java | 21 +++++++++++++++++++ .../internal/store/tiering/TieredStore.java | 6 ++++++ 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java index b4a7eb4808..19f80cfbc1 100644 --- a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java +++ b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java @@ -25,7 +25,7 @@ */ public class StoreAccessRuntimeException extends RuntimeException { - private static final long serialVersionUID = 1L; + private static final long serialVersionUID = 6249505400891654776L; /** * Creates a new exception wrapping the {@link Throwable cause} passed in. @@ -55,6 +55,13 @@ public StoreAccessRuntimeException(String message) { super(message); } + /** + * Wrapped the received {@link java.lang.RuntimeException} to {@link org.ehcache.spi.resilience.StoreAccessException}, + * so that received {@link java.lang.RuntimeException} can reach {@link org.ehcache.spi.resilience.ResilienceStrategy} + * + * @param re a {@link java.lang.RuntimeException} that is being handled + * @return {@link org.ehcache.spi.resilience.StoreAccessException} a type in which wrapping the received {@link java.lang.RuntimeException} + */ public static StoreAccessException handleRuntimeException(RuntimeException re) { if (re instanceof StoreAccessRuntimeException || re instanceof CompletionException) { diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java index b682f9776c..910cf1df6b 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java @@ -1002,6 +1002,10 @@ private static class Fault extends OnHeapValueHolder { @IgnoreSizeOf private final Supplier> source; + + /** + * valueFuture of type {@link java.util.concurrent.CompletableFuture} to ensure consistent state in concurrent usage + */ private CompletableFuture> valueFuture; public Fault(Supplier> source) { @@ -1010,14 +1014,28 @@ public Fault(Supplier> source) { this.valueFuture = new CompletableFuture<>(); } + /** + * Block the thread coming to get the value in concurrent usage + * + * @return {@link org.ehcache.core.spi.store.Store.ValueHolder} + */ private ValueHolder retrieveValueHolder(){ return source.get(); } + /** + * mark the process for fault object as completed in concurrent usage + */ private void complete(ValueHolder value) { valueFuture.complete(value); } + /** + * method to get the {@link org.ehcache.core.spi.store.Store.ValueHolder} + * Block the thread coming to get the value in concurrent usage + * + * @return {@link org.ehcache.core.spi.store.Store.ValueHolder} + */ private ValueHolder getValueHolder() { return valueFuture.join(); } @@ -1027,6 +1045,9 @@ public long getId() { throw new UnsupportedOperationException("You should NOT call that?!"); } + /** + * method to mark the Fault object process is failed + */ private void fail(Throwable t) { valueFuture.completeExceptionally(t); } diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java index af035127b4..2b4aa786fc 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/tiering/TieredStore.java @@ -374,6 +374,12 @@ private CachingTier cachingTier() { return cachingTierRef.get(); } + /** + * Handling the received {@link org.ehcache.spi.resilience.StoreAccessException} + * + * @param ce a {@link org.ehcache.spi.resilience.StoreAccessException} that is being handled + * @return {@link org.ehcache.core.spi.store.Store.ValueHolder} + */ private ValueHolder handleStoreAccessException(StoreAccessException ce) throws StoreAccessException { Throwable cause = ce.getCause(); if (cause instanceof StorePassThroughException) { From af346e7c8dde5ddd72ddf54e2c049e3fc2f18230 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Thu, 13 Oct 2022 17:54:39 +0530 Subject: [PATCH 09/12] issue-2887 : updating Fault.toString() --- .../impl/internal/store/heap/OnHeapStore.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java index 910cf1df6b..c2d5161896 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java @@ -1105,10 +1105,16 @@ public long size() { @Override public String toString() { String valueOrException; - try { - valueOrException = valueFuture.get().toString(); - } catch (InterruptedException | ExecutionException e) { - valueOrException = e.toString(); + if (valueFuture.isDone()) { + if (valueFuture.isCancelled()) { + valueOrException = "Cancel"; + } else if (valueFuture.isCompletedExceptionally()) { + valueOrException = "Exception"; + } else { + valueOrException = "Complete"; + } + } else { + valueOrException = "InComplete"; } return "[Fault : " + valueOrException + "]"; } From 864cc9c2fd447d3f60aa272411d538ff21f336b9 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Fri, 14 Oct 2022 18:44:33 +0530 Subject: [PATCH 10/12] issue-2887 : Accomodating review comment --- .../client/internal/store/ClusteredStore.java | 2 +- .../store/StoreComputeIfAbsentTest.java | 7 ++-- .../ehcache/internal/store/StoreSPITest.java | 2 +- .../StoreAccessRuntimeException.java | 24 ++++--------- .../exceptions/StorePassThroughException.java | 7 ++-- .../impl/internal/store/heap/OnHeapStore.java | 35 +++++++------------ .../store/tiering/TieredStoreTest.java | 10 +++--- 7 files changed, 35 insertions(+), 52 deletions(-) diff --git a/clustered/ehcache-client/src/main/java/org/ehcache/clustered/client/internal/store/ClusteredStore.java b/clustered/ehcache-client/src/main/java/org/ehcache/clustered/client/internal/store/ClusteredStore.java index 015590af2c..149407fa70 100644 --- a/clustered/ehcache-client/src/main/java/org/ehcache/clustered/client/internal/store/ClusteredStore.java +++ b/clustered/ehcache-client/src/main/java/org/ehcache/clustered/client/internal/store/ClusteredStore.java @@ -580,7 +580,7 @@ public ValueHolder getAndFault(K key) throws StoreAccessException { } @Override - public ValueHolder computeIfAbsentAndFault(K key, Function mappingFunction) throws StoreAccessException { + public ValueHolder computeIfAbsentAndFault(K key, Function mappingFunction) { return computeIfAbsent(key, mappingFunction); } diff --git a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreComputeIfAbsentTest.java b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreComputeIfAbsentTest.java index 3017f59bcd..c04ebd8109 100644 --- a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreComputeIfAbsentTest.java +++ b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreComputeIfAbsentTest.java @@ -21,6 +21,7 @@ import org.ehcache.core.spi.store.Store; import org.ehcache.expiry.ExpiryPolicy; import org.ehcache.internal.TestTimeSource; +import org.ehcache.spi.resilience.StoreAccessRuntimeException; import org.ehcache.spi.test.After; import org.ehcache.spi.test.LegalSPITesterException; import org.ehcache.spi.test.SPITest; @@ -193,14 +194,14 @@ public void testStorePassThroughException() throws Exception { K key = factory.createKey(1L); - RuntimeException exception = new RuntimeException("error"); - StorePassThroughException re = new StorePassThroughException(exception); + StoreAccessException exception = new StoreAccessException("error"); + StoreAccessRuntimeException re = new StoreAccessRuntimeException(exception); try { kvStore.computeIfAbsent(key, keyParam -> { throw re; }); - } catch (RuntimeException e) { + } catch (Exception e) { assertThat(e, is(exception)); } } diff --git a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java index dc45ed1611..3d273c2878 100644 --- a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java +++ b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java @@ -33,7 +33,7 @@ public void testGetAndCompute() throws Exception { } @Test - @Ignore("TieredStoreSPITest#testComputeIfAbsent, TieredStoreWith3TiersSPITest#testComputeIfAbsent" ) +// @Ignore("TieredStoreSPITest#testComputeIfAbsent, TieredStoreWith3TiersSPITest#testComputeIfAbsent" ) public void testComputeIfAbsent() throws Exception { StoreComputeIfAbsentTest testSuite = new StoreComputeIfAbsentTest<>(getStoreFactory()); testSuite.runTestSuite().reportAndThrow(); diff --git a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java index 19f80cfbc1..e4d6a3d521 100644 --- a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java +++ b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java @@ -32,28 +32,18 @@ public class StoreAccessRuntimeException extends RuntimeException { * * @param cause the cause of this exception */ - public StoreAccessRuntimeException(Throwable cause) { + public StoreAccessRuntimeException(StoreAccessException cause) { super(cause); } - /** - * Creates a new exception wrapping the {@link Throwable cause} passed in and with the provided message. - * - * @param message information about the exception - * @param cause the cause of this exception - */ - public StoreAccessRuntimeException(String message, Throwable cause) { - super(message, cause); + @Override + public StoreAccessException getCause() { + return (StoreAccessException) super.getCause(); } - /** - * Creates a new exception with the provided message. - * - * @param message information about the exception - */ - public StoreAccessRuntimeException(String message) { - super(message); - } +/* public StoreAccessException getStoreAccessException() { + return getCause(); + }*/ /** * Wrapped the received {@link java.lang.RuntimeException} to {@link org.ehcache.spi.resilience.StoreAccessException}, diff --git a/ehcache-core/src/main/java/org/ehcache/core/exceptions/StorePassThroughException.java b/ehcache-core/src/main/java/org/ehcache/core/exceptions/StorePassThroughException.java index 62593508b0..89367e23bc 100644 --- a/ehcache-core/src/main/java/org/ehcache/core/exceptions/StorePassThroughException.java +++ b/ehcache-core/src/main/java/org/ehcache/core/exceptions/StorePassThroughException.java @@ -18,6 +18,7 @@ import org.ehcache.javadoc.PublicApi; import org.ehcache.spi.resilience.StoreAccessException; +import org.ehcache.spi.resilience.StoreAccessRuntimeException; /** * A generic wrapper runtime exception that will not be caught and @@ -69,13 +70,15 @@ public synchronized Throwable fillInStackTrace() { * @throws RuntimeException if {@code re} is a {@code StorePassThroughException} containing a {@code RuntimeException} */ public static StoreAccessException handleException(Exception re) { - if(re instanceof StorePassThroughException) { + if (re instanceof StorePassThroughException) { Throwable cause = re.getCause(); - if(cause instanceof RuntimeException) { + if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { return new StoreAccessException(cause); } + } else if (re instanceof StoreAccessRuntimeException) { + return (StoreAccessException) re.getCause(); } else { return new StoreAccessException(re); } diff --git a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java index c2d5161896..6f48dc0f8c 100644 --- a/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java +++ b/ehcache-impl/src/main/java/org/ehcache/impl/internal/store/heap/OnHeapStore.java @@ -52,7 +52,7 @@ import org.ehcache.core.spi.time.TimeSourceService; import org.ehcache.impl.store.HashUtils; import org.ehcache.impl.serialization.TransientStateRepository; -import org.ehcache.sizeof.annotations.IgnoreSizeOf; +import org.ehcache.spi.resilience.StoreAccessRuntimeException; import org.ehcache.spi.serialization.Serializer; import org.ehcache.spi.serialization.StatefulSerializer; import org.ehcache.core.spi.store.Store; @@ -90,7 +90,6 @@ import java.util.Random; import java.util.Set; import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.function.BiFunction; @@ -704,11 +703,11 @@ public ValueHolder getOrComputeIfAbsent(K key, Function> so long now = timeSource.getTimeMillis(); if (cachedValue == null) { - Fault fault = new Fault<>(() -> source.apply(key)); + Fault fault = new Fault<>(); cachedValue = backEnd.putIfAbsent(key, fault); if (cachedValue == null) { - ValueHolder valueHolder = resolveFault(key, backEnd, now, fault); + ValueHolder valueHolder = resolveFault(key, backEnd, now, fault, source); fault.complete(valueHolder); return valueHolder; } @@ -721,11 +720,11 @@ public ValueHolder getOrComputeIfAbsent(K key, Function> so expireMappingUnderLock(key, cachedValue); // On expiration, we might still be able to get a value from the fault. For instance, when a load-writer is used - Fault fault = new Fault<>(() -> source.apply(key)); + Fault fault = new Fault<>(); cachedValue = backEnd.putIfAbsent(key, fault); if (cachedValue == null) { - ValueHolder valueHolder = resolveFault(key, backEnd, now, fault); + ValueHolder valueHolder = resolveFault(key, backEnd, now, fault, source); fault.complete(valueHolder); return valueHolder; } @@ -771,9 +770,9 @@ public ValueHolder getOrDefault(K key, Function> source) th } } - private ValueHolder resolveFault(K key, Backend backEnd, long now, Fault fault) throws StoreAccessException { + private ValueHolder resolveFault(K key, Backend backEnd, long now, Fault fault, Function> source) throws StoreAccessException { try { - ValueHolder value = fault.retrieveValueHolder(); + ValueHolder value = source.apply(key); OnHeapValueHolder newValue; if(value != null) { newValue = importValueFromLowerTier(key, value, now, backEnd, fault); @@ -817,7 +816,10 @@ private ValueHolder resolveFault(K key, Backend backEnd, long now, Faul getOrComputeIfAbsentObserver.end(CachingTierOperationOutcomes.GetOrComputeIfAbsentOutcome.FAULT_FAILED); return newValue; - + } catch (StoreAccessRuntimeException e) { + fault.fail(e); + backEnd.remove(key, fault); + throw e.getCause(); } catch (Throwable e) { fault.fail(e); backEnd.remove(key, fault); @@ -1000,29 +1002,16 @@ private static class Fault extends OnHeapValueHolder { private static final int FAULT_ID = -1; - @IgnoreSizeOf - private final Supplier> source; - /** * valueFuture of type {@link java.util.concurrent.CompletableFuture} to ensure consistent state in concurrent usage */ private CompletableFuture> valueFuture; - public Fault(Supplier> source) { + public Fault() { super(FAULT_ID, 0, true); - this.source = source; this.valueFuture = new CompletableFuture<>(); } - /** - * Block the thread coming to get the value in concurrent usage - * - * @return {@link org.ehcache.core.spi.store.Store.ValueHolder} - */ - private ValueHolder retrieveValueHolder(){ - return source.get(); - } - /** * mark the process for fault object as completed in concurrent usage */ diff --git a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java index b0105e0a32..5fcfebe8ef 100644 --- a/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java +++ b/ehcache-impl/src/test/java/org/ehcache/impl/internal/store/tiering/TieredStoreTest.java @@ -146,14 +146,14 @@ public void testGetMisses() throws Exception { @SuppressWarnings("unchecked") public void testGetThrowsRuntimeException() throws Exception { RuntimeException error = new RuntimeException(); - when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessException(error)); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); try { tieredStore.get(1); fail("We should get an Error"); - } catch (RuntimeException e) { + } catch (Exception e) { assertSame(error, e.getCause()); } } @@ -195,7 +195,7 @@ public void testGetThrowsError() throws Exception { @Test @SuppressWarnings("unchecked") public void testGetThrowsException() throws Exception { - Exception error = new Exception(); + StoreAccessException error = new StoreAccessException("Error"); when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); @@ -441,7 +441,7 @@ public void testComputeIfAbsentThrowsError() throws Exception { public void testComputeIfAbsentThrowsRuntimeException() throws Exception { RuntimeException error = new RuntimeException(); - when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(new StoreAccessRuntimeException(error)); + when(numberCachingTier.getOrComputeIfAbsent(any(Number.class), any(Function.class))).thenThrow(error); TieredStore tieredStore = new TieredStore<>(numberCachingTier, numberAuthoritativeTier); @@ -449,7 +449,7 @@ public void testComputeIfAbsentThrowsRuntimeException() throws Exception { tieredStore.computeIfAbsent(1, n -> null); fail("We should get an Error"); } catch (RuntimeException e) { - assertSame(error, e.getCause()); + assertSame(error, e); } } From 1389341e0351776010531be60070dfdf398cc10a Mon Sep 17 00:00:00 2001 From: Nishchay Date: Fri, 14 Oct 2022 18:47:22 +0530 Subject: [PATCH 11/12] issue-2887 : updating last commit --- .../src/main/java/org/ehcache/internal/store/StoreSPITest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java index 3d273c2878..84dc8005a4 100644 --- a/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java +++ b/core-spi-test/src/main/java/org/ehcache/internal/store/StoreSPITest.java @@ -33,7 +33,6 @@ public void testGetAndCompute() throws Exception { } @Test -// @Ignore("TieredStoreSPITest#testComputeIfAbsent, TieredStoreWith3TiersSPITest#testComputeIfAbsent" ) public void testComputeIfAbsent() throws Exception { StoreComputeIfAbsentTest testSuite = new StoreComputeIfAbsentTest<>(getStoreFactory()); testSuite.runTestSuite().reportAndThrow(); From 5896537e766c051f8efcc533069052d7e95c7df7 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Fri, 14 Oct 2022 19:07:08 +0530 Subject: [PATCH 12/12] issue-2887 : updating last commit --- .../ehcache/spi/resilience/StoreAccessRuntimeException.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java index e4d6a3d521..684e276a14 100644 --- a/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java +++ b/ehcache-api/src/main/java/org/ehcache/spi/resilience/StoreAccessRuntimeException.java @@ -41,10 +41,6 @@ public StoreAccessException getCause() { return (StoreAccessException) super.getCause(); } -/* public StoreAccessException getStoreAccessException() { - return getCause(); - }*/ - /** * Wrapped the received {@link java.lang.RuntimeException} to {@link org.ehcache.spi.resilience.StoreAccessException}, * so that received {@link java.lang.RuntimeException} can reach {@link org.ehcache.spi.resilience.ResilienceStrategy}