private void throwIfImmutableTsOrCommitLocksExpired(@Nullable LockToken commitLocksToken) { Set<LockToken> expiredLocks = refreshCommitAndImmutableTsLocks(commitLocksToken); if (!expiredLocks.isEmpty()) { final String baseMsg = "Required locks are no longer valid. "; String expiredLocksErrorString = getExpiredLocksErrorString(commitLocksToken, expiredLocks); TransactionLockTimeoutException ex = new TransactionLockTimeoutException(baseMsg + expiredLocksErrorString); log.error(baseMsg + "{}", expiredLocksErrorString, ex); transactionOutcomeMetrics.markLocksExpired(); throw ex; } }
@Override public void throwIfConditionInvalid(long timestamp) { if (lockService.refreshLockRefreshTokens(Collections.singleton(heldLock.getLockRefreshToken())).isEmpty()) { log.warn("Lock service locks were no longer valid", UnsafeArg.of("invalidToken", heldLock.getLockRefreshToken())); throw new TransactionLockTimeoutException("Provided transaction lock expired. Token: " + heldLock.getLockRefreshToken()); } }
public T execute(Transaction transaction) throws E { try { return delegate.execute(transaction); } catch (Exception ex) { if (shouldRethrowWithoutLockValidation(ex) || immutableTsLockIsValid()) { throw ex; } throw new TransactionLockTimeoutException( "The following immutable timestamp lock is no longer valid: " + immutableTsLock); } }
if (!expiredLocks.isEmpty()) { transactionOutcomeMetrics.markLocksExpired(); throw new TransactionLockTimeoutException("Our commit was already rolled back at commit time" + " because our locks timed out. startTs: " + getStartTimestamp() + ". " + getExpiredLocksErrorString(commitLocksToken, expiredLocks), ex);
private void throwIfImmutableTsOrCommitLocksExpired(@Nullable LockToken commitLocksToken) { Set<LockToken> expiredLocks = refreshCommitAndImmutableTsLocks(commitLocksToken); if (!expiredLocks.isEmpty()) { final String baseMsg = "Required locks are no longer valid. "; String expiredLocksErrorString = getExpiredLocksErrorString(commitLocksToken, expiredLocks); TransactionLockTimeoutException ex = new TransactionLockTimeoutException(baseMsg + expiredLocksErrorString); log.error(baseMsg + "{}", expiredLocksErrorString, ex); transactionOutcomeMetrics.markLocksExpired(); throw ex; } }
@Override public void throwIfConditionInvalid(long timestamp) { if (lockService.refreshLockRefreshTokens(Collections.singleton(heldLock.getLockRefreshToken())).isEmpty()) { log.warn("Lock service locks were no longer valid", UnsafeArg.of("invalidToken", heldLock.getLockRefreshToken())); throw new TransactionLockTimeoutException("Provided transaction lock expired. Token: " + heldLock.getLockRefreshToken()); } }
public T execute(Transaction transaction) throws E { try { return delegate.execute(transaction); } catch (Exception ex) { if (shouldRethrowWithoutLockValidation(ex) || immutableTsLockIsValid()) { throw ex; } throw new TransactionLockTimeoutException( "The following immutable timestamp lock is no longer valid: " + immutableTsLock); } }
if (!expiredLocks.isEmpty()) { transactionOutcomeMetrics.markLocksExpired(); throw new TransactionLockTimeoutException("Our commit was already rolled back at commit time" + " because our locks timed out. startTs: " + getStartTimestamp() + ". " + getExpiredLocksErrorString(commitLocksToken, expiredLocks), ex);