use of com.palantir.atlasdb.transaction.api.TransactionLockWatchFailedException in project atlasdb by palantir.
the class ValidatingTransactionScopedCache method failAndLog.
private void failAndLog(Arg<?>... args) {
SafeRuntimeException runtimeException = new SafeRuntimeException("I exist to show you the stacktrace");
log.error("Reading from lock watch cache returned a different result to a remote read - this indicates there " + "is a corruption bug in the caching logic", Arrays.stream(args).collect(Collectors.toList()), runtimeException);
failureCallback.run();
throw new TransactionLockWatchFailedException("Failed lock watch cache validation - will retry without caching");
}
use of com.palantir.atlasdb.transaction.api.TransactionLockWatchFailedException in project atlasdb by palantir.
the class ResilientLockWatchProxyTest method lockWatchFailedExceptionDoesNotCauseFallbackToBeUsed.
@Test
public void lockWatchFailedExceptionDoesNotCauseFallbackToBeUsed() {
TransactionLockWatchFailedException lockWatchFailedException = new TransactionLockWatchFailedException("fail");
when(defaultCache.getCommitUpdate(anyLong())).thenThrow(lockWatchFailedException);
assertThatThrownBy(() -> proxyEventCache.getCommitUpdate(0L)).isEqualTo(lockWatchFailedException);
proxyEventCache.lastKnownVersion();
verify(defaultCache).lastKnownVersion();
verify(fallbackCache, never()).lastKnownVersion();
}
Aggregations