Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Commit a5888d7

Browse files
add logs to debug
1 parent 63dc87d commit a5888d7

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

google-cloud-spanner/src/main/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClient.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -417,10 +417,10 @@ void setPool(SessionPool pool) {
417417
}
418418

419419
private void maybeWaitForSessionCreation(
420-
SessionPoolOptions sessionPoolOptions, SettableApiFuture<SessionReference> future) {
420+
SessionPoolOptions sessionPoolOptions, SettableApiFuture<SessionReference> initialSessionReferenceFuture) {
421421
Duration waitDuration = sessionPoolOptions.getWaitForMinSessions();
422422
SpannerException lastException = null;
423-
SettableApiFuture<SessionReference> sessionReferenceFuture = future;
423+
SettableApiFuture<SessionReference> sessionReferenceFuture = initialSessionReferenceFuture;
424424

425425
if (waitDuration != null && !waitDuration.isZero()) {
426426
Instant endTime = Instant.now().plus(waitDuration);
@@ -433,6 +433,7 @@ private void maybeWaitForSessionCreation(
433433
}
434434
// Calculate the remaining time pending for the future to wait for multiplexed session
435435
Duration remainingTime = Duration.between(Instant.now(), endTime);
436+
System.out.println("Remaining time: " + remainingTime.toMillis());
436437
try {
437438
sessionReferenceFuture.get(remainingTime.toMillis(), TimeUnit.MILLISECONDS);
438439
lastException = null;

google-cloud-spanner/src/test/java/com/google/cloud/spanner/MultiplexedSessionDatabaseClientMockServerTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ public void testRetryWithDelayedInResponseExceedsSessionCreationWaitTime() {
393393
.build()
394394
.getService();
395395

396+
System.out.println("---------------START------------------------");
396397
SpannerException spannerException =
397398
assertThrows(
398399
SpannerException.class,
@@ -407,6 +408,7 @@ public void testRetryWithDelayedInResponseExceedsSessionCreationWaitTime() {
407408
}
408409
}
409410
});
411+
System.out.println("--------------END-----------------------");
410412
assertEquals(ErrorCode.DEADLINE_EXCEEDED, spannerException.getErrorCode());
411413

412414
List<CreateSessionRequest> createSessionRequests =

0 commit comments

Comments
 (0)