Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
edc5bbf
fix: prevent illegal negative timeout values into thread sleep() meth…
arpan14 Feb 6, 2023
49a85df
Merge pull request #1 from arpan14/retryerror
arpan14 Feb 8, 2023
4cd497b
Fixing lint issues.
arpan14 Feb 8, 2023
4a6aa8e
Merge branch 'googleapis:main' into main
arpan14 Mar 13, 2023
b2aa09d
Merge branch 'googleapis:main' into main
arpan14 Mar 15, 2023
8d6d71e
Merge branch 'googleapis:main' into main
arpan14 May 9, 2023
77e6e7d
Merge branch 'googleapis:main' into main
arpan14 Jul 17, 2023
e8b7fad
Merge branch 'googleapis:main' into main
arpan14 Jul 25, 2023
8aa84e1
Merge branch 'googleapis:main' into main
arpan14 Oct 10, 2023
922f324
refactor: move session lastUseTime parameter from PooledSession to Se…
arpan14 Oct 17, 2023
b544080
chore: add clock instances in callees of SessionImpl.
arpan14 Oct 19, 2023
9862265
chore: partially fix failing unit tests in SessionPoolTest and Sessio…
arpan14 Oct 26, 2023
5e5f769
chore: fix failing tests in SessionPoolStressTest.
arpan14 Oct 27, 2023
a385ceb
chore: update lastUseTime for methods in SessionPoolTransactionContex…
arpan14 Oct 27, 2023
fd3bb41
chore: lint errors.
arpan14 Oct 27, 2023
4864053
chore: fix tests in DatabaseClientImplTest by passing the mocked cloc…
arpan14 Oct 27, 2023
f5b82fa
fix: update session lastUseTime field for AbstractReadContext class. …
arpan14 Oct 28, 2023
73f0192
fix: failing tests in TransactionRunnerImplTest.
arpan14 Oct 29, 2023
ff32178
fix: failing test in SessionPoolMaintainerTest.
arpan14 Oct 29, 2023
1316579
refactor: move FakeClock to a new class.
arpan14 Oct 29, 2023
80dd971
refactor: move Clock to a new class.
arpan14 Oct 30, 2023
1acd645
chore: resolving PR comments.
arpan14 Oct 31, 2023
6af8187
chore: address review comments.
arpan14 Oct 31, 2023
999a39b
chore: updating lastUseTime state in TransactionRunnerImpl. Removing …
arpan14 Oct 31, 2023
ec80d6a
chore: remove redundant update statements from SessionPool class. Add…
arpan14 Nov 1, 2023
6cdef81
chore: add more tests for TransactionRunner.
arpan14 Nov 1, 2023
593a10b
chore: remove dead code from constructor of SessionPoolTransactionCon…
arpan14 Nov 1, 2023
ced1e06
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Nov 1, 2023
0485aee
Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/Tr…
arpan14 Nov 2, 2023
c4163d8
Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/Tr…
arpan14 Nov 2, 2023
b75b19f
Update google-cloud-spanner/src/main/java/com/google/cloud/spanner/Tr…
arpan14 Nov 2, 2023
86327e2
chore: fixing precondition errors due to null clock.
arpan14 Nov 2, 2023
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: remove dead code from constructor of SessionPoolTransactionCon…
…text.
  • Loading branch information
arpan14 committed Nov 1, 2023
commit 593a10bd937636cc04eaa848ecaf3b741eb740dc
Original file line number Diff line number Diff line change
Expand Up @@ -622,18 +622,10 @@ public CursorState tryNext() {
static class SessionPoolTransactionContext implements TransactionContext {
private final SessionNotFoundHandler handler;
final TransactionContext delegate;
private final SessionImpl sessionImpl;
private final Clock clock;

SessionPoolTransactionContext(
SessionNotFoundHandler handler,
TransactionContext delegate,
SessionImpl sessionImpl,
Clock clock) {

SessionPoolTransactionContext(SessionNotFoundHandler handler, TransactionContext delegate) {
this.handler = Preconditions.checkNotNull(handler);
this.delegate = delegate;
this.sessionImpl = sessionImpl;
this.clock = clock;
}

@Override
Expand Down Expand Up @@ -831,9 +823,7 @@ public TransactionContext begin() {
}

private TransactionContext internalBegin() {
TransactionContext res =
new SessionPoolTransactionContext(
this, delegate.begin(), session.get().delegate, sessionPool.clock);
TransactionContext res = new SessionPoolTransactionContext(this, delegate.begin());
session.get().markUsed();
return res;
}
Expand Down Expand Up @@ -883,14 +873,11 @@ public TransactionContext resetForRetry() {
while (true) {
try {
if (restartedAfterSessionNotFound) {
TransactionContext res =
new SessionPoolTransactionContext(
this, delegate.begin(), session.get().delegate, sessionPool.clock);
TransactionContext res = new SessionPoolTransactionContext(this, delegate.begin());
restartedAfterSessionNotFound = false;
return res;
} else {
return new SessionPoolTransactionContext(
this, delegate.resetForRetry(), session.get().delegate, sessionPool.clock);
return new SessionPoolTransactionContext(this, delegate.resetForRetry());
}
} catch (SessionNotFoundException e) {
session = sessionPool.replaceSession(e, session);
Expand Down Expand Up @@ -2012,7 +1999,7 @@ enum Position {
private final ExecutorFactory<ScheduledExecutorService> executorFactory;

final PoolMaintainer poolMaintainer;
final Clock clock;
private final Clock clock;
/**
* initialReleasePosition determines where in the pool sessions are added when they are released
* into the pool the first time. This is always RANDOM in production, but some tests use FIRST to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,7 @@ public void onFailure(Throwable t) {
public void onSuccess(TransactionContext result) {
delegateTxnFuture.set(
new SessionPool.SessionPoolTransactionContext(
SessionPoolAsyncTransactionManager.this,
result,
session.get().delegate,
pool.clock));
SessionPoolAsyncTransactionManager.this, result));
}
},
MoreExecutors.directExecutor());
Expand Down Expand Up @@ -256,10 +253,7 @@ public TransactionContextFuture resetForRetryAsync() {
MoreExecutors.directExecutor()),
input ->
new SessionPool.SessionPoolTransactionContext(
SessionPoolAsyncTransactionManager.this,
input,
session.get().delegate,
pool.clock),
SessionPoolAsyncTransactionManager.this, input),
MoreExecutors.directExecutor()));
}

Expand Down