From 3dc290a9a21c57bce78b39efab1b20e64e59af21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Knut=20Olav=20L=C3=B8ite?= Date: Wed, 18 Dec 2024 15:18:27 +0100 Subject: [PATCH] chore: include session min/max in error message (#3566) --- .../java/com/google/cloud/spanner/SessionPool.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java index aba6aee1db8..ffaf913580b 100644 --- a/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java +++ b/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SessionPool.java @@ -2831,10 +2831,13 @@ private StringBuilder createCheckedOutSessionsStackTraces() { // Create the error message without holding the lock, as we are potentially looping through a // large set, and analyzing a large number of stack traces. StringBuilder stackTraces = - new StringBuilder( - "There are currently " - + currentlyCheckedOutSessions.size() - + " sessions checked out:\n\n"); + new StringBuilder("MinSessions: ") + .append(options.getMinSessions()) + .append("\nMaxSessions: ") + .append(options.getMaxSessions()) + .append("\nThere are currently ") + .append(currentlyCheckedOutSessions.size()) + .append(" sessions checked out:\n\n"); if (options.isTrackStackTraceOfSessionCheckout()) { for (PooledSessionFuture session : currentlyCheckedOutSessions) { if (session.leakedException != null) {