Skip to content
This repository has been archived by the owner on Nov 14, 2024. It is now read-only.

Make cache proxy exception handling more robust #7345

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions atlasdb-impl-shared/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies {

implementation 'com.github.ben-manes.caffeine:caffeine'
implementation 'com.palantir.common:streams'
implementation 'com.palantir.conjure.java.api:errors'
implementation 'com.palantir.conjure.java.runtime:conjure-java-jackson-serialization'
implementation 'com.palantir.safe-logging:safe-logging'
implementation 'com.palantir.safe-logging:preconditions'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.palantir.atlasdb.keyvalue.api.cache.CacheMetrics;
import com.palantir.atlasdb.keyvalue.api.cache.LockWatchValueScopingCache;
import com.palantir.atlasdb.transaction.api.TransactionLockWatchFailedException;
import com.palantir.conjure.java.api.errors.QosException;
import com.palantir.lock.watch.LockWatchEventCache;
import com.palantir.logsafe.Preconditions;
import com.palantir.logsafe.exceptions.SafeRuntimeException;
Expand All @@ -28,6 +29,7 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.concurrent.CancellationException;
import javax.annotation.concurrent.ThreadSafe;

@ThreadSafe
Expand Down Expand Up @@ -81,7 +83,7 @@ protected Object handleInvocation(Object proxy, Method method, Object[] args) th
private synchronized RuntimeException handleException(InvocationTargetException rethrow) {
try {
throw rethrow.getCause();
} catch (TransactionLockWatchFailedException e) {
} catch (TransactionLockWatchFailedException | QosException | CancellationException e) {
throw e;
} catch (Throwable t) {
if (delegate == fallbackCache) {
Expand Down