Skip to content

Commit f4741b0

Browse files
chore: generate libraries at Wed Dec 24 09:24:38 UTC 2025
1 parent 968a849 commit f4741b0

File tree

2 files changed

+28
-26
lines changed

2 files changed

+28
-26
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,8 +317,8 @@ public void close() {
317317
private final AtomicBoolean unimplemented = new AtomicBoolean(false);
318318

319319
/**
320-
* This flag is set to true if create session RPC is in progress. This flag prevents application
321-
* from firing two requests concurrently
320+
* This flag is set to true if create session RPC is in progress. This flag prevents application
321+
* from firing two requests concurrently
322322
*/
323323
private final AtomicBoolean retryingSessionCreation = new AtomicBoolean(true);
324324

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

Lines changed: 26 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ public void testDeadlineExceededErrorWithOneRetryWithParallelRequests()
308308
throws InterruptedException {
309309
mockSpanner.setCreateSessionExecutionTime(
310310
SimulatedExecutionTime.ofMinimumAndRandomTimeAndExceptions(
311-
2000, 0,
311+
2000,
312+
0,
312313
Arrays.asList(
313314
Status.DEADLINE_EXCEEDED
314315
.withDescription(
@@ -326,24 +327,24 @@ public void testDeadlineExceededErrorWithOneRetryWithParallelRequests()
326327
(DatabaseClientImpl) spanner.getDatabaseClient(DatabaseId.of("p", "i", "d"));
327328
assertNotNull(client.multiplexedSessionDatabaseClient);
328329

329-
330330
ExecutorService executor = Executors.newCachedThreadPool();
331331

332332
// First set of request should fail with an error
333333
CountDownLatch failureCountDownLatch = new CountDownLatch(3);
334334
for (int i = 0; i < 3; i++) {
335-
executor.submit(() -> {
336-
try {
337-
try (ResultSet resultSet = client.singleUse().executeQuery(STATEMENT)) {
338-
//noinspection StatementWithEmptyBody
339-
while (resultSet.next()) {
340-
// ignore
335+
executor.submit(
336+
() -> {
337+
try {
338+
try (ResultSet resultSet = client.singleUse().executeQuery(STATEMENT)) {
339+
//noinspection StatementWithEmptyBody
340+
while (resultSet.next()) {
341+
// ignore
342+
}
343+
}
344+
} catch (SpannerException e) {
345+
failureCountDownLatch.countDown();
341346
}
342-
}
343-
} catch (SpannerException e) {
344-
failureCountDownLatch.countDown();
345-
}
346-
});
347+
});
347348
}
348349

349350
assertTrue(failureCountDownLatch.await(2, TimeUnit.SECONDS));
@@ -352,18 +353,19 @@ public void testDeadlineExceededErrorWithOneRetryWithParallelRequests()
352353
// Second set of requests should pass
353354
CountDownLatch countDownLatch = new CountDownLatch(3);
354355
for (int i = 0; i < 3; i++) {
355-
executor.submit(() -> {
356-
try {
357-
try (ResultSet resultSet = client.singleUse().executeQuery(STATEMENT)) {
358-
//noinspection StatementWithEmptyBody
359-
while (resultSet.next()) {
360-
// ignore
356+
executor.submit(
357+
() -> {
358+
try {
359+
try (ResultSet resultSet = client.singleUse().executeQuery(STATEMENT)) {
360+
//noinspection StatementWithEmptyBody
361+
while (resultSet.next()) {
362+
// ignore
363+
}
364+
}
365+
} catch (SpannerException e) {
366+
countDownLatch.countDown();
361367
}
362-
}
363-
} catch (SpannerException e) {
364-
countDownLatch.countDown();
365-
}
366-
});
368+
});
367369
}
368370

369371
assertFalse(countDownLatch.await(3, TimeUnit.SECONDS));

0 commit comments

Comments
 (0)