Skip to content

Commit eff1645

Browse files
authored
Merge pull request #650 from alex268/master
Update log messages in the session pools
2 parents b4e5fa2 + d02fb60 commit eff1645

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

query/src/main/java/tech/ydb/query/impl/SessionPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public void destroy() {
252252

253253
@Override
254254
public void close() {
255-
logger.trace("QuerySession[{}] closed with broke status {}", getId(), isBroken);
255+
logger.trace("QuerySession[{}] closed with broken status {}", getId(), isBroken);
256256

257257
stats.released.increment();
258258
if (isBroken || isStopped) {
@@ -328,6 +328,7 @@ public void run() {
328328
PooledQuerySession session = coldIterator.next();
329329
if (!session.getLastActive().isAfter(idleToRemove) && queue.getTotalCount() > minSize) {
330330
coldIterator.remove();
331+
logger.debug("QuerySession[{}] was deleted by idle timeout", session.getId());
331332
}
332333
}
333334
}

table/src/main/java/tech/ydb/table/impl/pool/SessionPool.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public SessionPoolStats stats() {
8585
}
8686

8787
public CompletableFuture<Result<Session>> acquire(Duration timeout) {
88-
logger.debug("acquire session with timeout {}", timeout);
88+
logger.trace("acquire session with timeout {}", timeout);
8989

9090
CompletableFuture<Result<Session>> future = new CompletableFuture<>();
9191

@@ -131,7 +131,7 @@ private boolean pollNext(CompletableFuture<Result<Session>> future) {
131131

132132
private boolean validateSession(ClosableSession session, CompletableFuture<Result<Session>> future) {
133133
if (session.state().switchToActive(clock.instant())) {
134-
logger.debug("session {} accepted", session.getId());
134+
logger.trace("session {} accepted", session.getId());
135135
if (future.complete(Result.success(session))) {
136136
stats.acquired.increment();
137137
} else {
@@ -261,6 +261,7 @@ public void run() {
261261

262262
if (!state.lastActive().isAfter(idleToRemove) && queue.getTotalCount() > minSize) {
263263
coldIterator.remove();
264+
logger.debug("session {} was deleted by idle timeout", session.getId());
264265
continue;
265266
}
266267

table/src/main/java/tech/ydb/table/impl/pool/StatefulSession.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ private State updated(Instant now, Throwable th, StatusCode code, boolean shutdo
116116

117117
// and if we found it state switch to broken status
118118
if (broken) {
119+
logger.debug("{} broken by status code {}", this, code);
119120
return new State(Status.BROKEN, lastActive, now);
120121
}
121122

@@ -125,6 +126,7 @@ private State updated(Instant now, Throwable th, StatusCode code, boolean shutdo
125126

126127
if (status == Status.ACTIVE) {
127128
if (shutdownHint) {
129+
logger.debug("{} broken by shutdown hint", this);
128130
return new State(Status.NEED_SHUTDOWN, now);
129131
}
130132
return new State(status, now);

0 commit comments

Comments
 (0)