88
99namespace Ydb . Sdk . Ado . Session ;
1010
11- internal class Session : IPoolingSession
11+ internal class PoolingSession : IPoolingSession
1212{
1313 private const string SessionBalancer = "session-balancer" ;
1414
@@ -18,20 +18,20 @@ internal class Session : IPoolingSession
1818 private readonly IDriver _driver ;
1919 private readonly PoolingSessionSource _poolingSessionSource ;
2020 private readonly YdbConnectionStringBuilder _settings ;
21- private readonly ILogger < Session > _logger ;
21+ private readonly ILogger < PoolingSession > _logger ;
2222
23- private volatile bool _isActive ;
23+ private volatile bool _isBroken ;
2424
2525 private string SessionId { get ; set ; } = string . Empty ;
2626 private long NodeId { get ; set ; }
2727
28- public bool IsActive => _isActive ;
28+ public bool IsBroken => _isBroken ;
2929
30- internal Session (
30+ internal PoolingSession (
3131 IDriver driver ,
3232 PoolingSessionSource poolingSessionSource ,
3333 YdbConnectionStringBuilder settings ,
34- ILogger < Session > logger
34+ ILogger < PoolingSession > logger
3535 )
3636 {
3737 _driver = driver ;
@@ -109,7 +109,7 @@ StatusCode.Unavailable or
109109 {
110110 _logger . LogWarning ( "Session[{SessionId}] is deactivated. Reason StatusCode: {Code}" , SessionId , code ) ;
111111
112- _isActive = false ;
112+ _isBroken = true ;
113113 }
114114 }
115115
@@ -176,7 +176,7 @@ public async Task Open(CancellationToken cancellationToken)
176176
177177 OnNotSuccessStatusCode ( statusCode ) ;
178178
179- if ( ! IsActive )
179+ if ( IsBroken )
180180 {
181181 return ;
182182 }
@@ -204,7 +204,7 @@ public async Task Open(CancellationToken cancellationToken)
204204 }
205205 finally
206206 {
207- _isActive = false ;
207+ _isBroken = true ;
208208 }
209209 } , cancellationToken ) ;
210210
@@ -215,7 +215,12 @@ public async Task DeleteSession()
215215 {
216216 try
217217 {
218- _isActive = false ;
218+ if ( _isBroken )
219+ {
220+ return ;
221+ }
222+
223+ _isBroken = true ;
219224
220225 var deleteSessionResponse = await _driver . UnaryCall (
221226 QueryService . DeleteSessionMethod ,
0 commit comments