Skip to content

Commit 8d24e7e

Browse files
dev: update log level on AttachStream
1 parent fdc94d5 commit 8d24e7e

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/Ydb.Sdk/src/Services/Query/SessionPool.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,31 @@ protected override async Task<Session> CreateSession()
7474
// ReSharper disable once InvertIf
7575
if (!session.IsActive)
7676
{
77-
Logger.LogWarning("Session[{SessionId}] is deactivated", session.SessionId);
77+
Logger.LogWarning("Session[{SessionId}] is deactivated. Reason: {Status}",
78+
session.SessionId, sessionStateStatus);
7879

7980
return;
8081
}
8182
}
8283

84+
Logger.LogDebug("Session[{SessionId}]: Attached stream is closed", session.SessionId);
85+
8386
// attach stream is closed
8487
}
85-
catch (Driver.TransportException)
88+
catch (Driver.TransportException e)
8689
{
90+
Logger.LogWarning(e, "Session[{SessionId}] is deactivated by transport error", session.SessionId);
8791
}
8892
}
89-
catch (Exception e)
93+
catch (Driver.TransportException e)
9094
{
95+
Logger.LogError(e, "Transport error on attach session");
96+
9197
completeTask.SetException(e);
9298
}
9399
finally
94100
{
95101
session.IsActive = false;
96-
97-
Logger.LogTrace("Session[{SessionId}]: Attached stream is closed", session.SessionId);
98102
}
99103
});
100104

0 commit comments

Comments
 (0)