Skip to content

Commit b59076f

Browse files
Fixed bug: Grpc.Core.StatusCode.Cancelled was mapped to server's Canceled status.
1 parent f8c707c commit b59076f

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/Ydb.Sdk/src/Ado/Session/PoolingSession.cs

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
// This file contains session pooling algorithms adapted from Npgsql
2-
// Original source: https://github.com/npgsql/npgsql
3-
// Copyright (c) 2002-2025, Npgsql
4-
// Licence https://github.com/npgsql/npgsql?tab=PostgreSQL-1-ov-file
5-
61
using Microsoft.Extensions.Logging;
72
using Ydb.Query;
83
using Ydb.Query.V1;
@@ -22,11 +17,12 @@ internal class PoolingSession : IPoolingSession
2217

2318
private readonly IDriver _driver;
2419
private readonly PoolingSessionSource _poolingSessionSource;
25-
private readonly YdbConnectionStringBuilder _settings;
2620
private readonly ILogger<PoolingSession> _logger;
2721

2822
private volatile bool _isBroken;
2923

24+
private readonly bool _disableServerBalancer;
25+
3026
private string SessionId { get; set; } = string.Empty;
3127
private long NodeId { get; set; }
3228

@@ -35,13 +31,13 @@ internal class PoolingSession : IPoolingSession
3531
internal PoolingSession(
3632
IDriver driver,
3733
PoolingSessionSource poolingSessionSource,
38-
YdbConnectionStringBuilder settings,
34+
bool disableServerBalancer,
3935
ILogger<PoolingSession> logger
4036
)
4137
{
4238
_driver = driver;
4339
_poolingSessionSource = poolingSessionSource;
44-
_settings = settings;
40+
_disableServerBalancer = disableServerBalancer;
4541
_logger = logger;
4642
}
4743

@@ -122,7 +118,7 @@ public async Task Open(CancellationToken cancellationToken)
122118
{
123119
var requestSettings = new GrpcRequestSettings { CancellationToken = cancellationToken };
124120

125-
if (!_settings.DisableServerBalancer)
121+
if (!_disableServerBalancer)
126122
{
127123
requestSettings.ClientCapabilities.Add(SessionBalancer);
128124
}

0 commit comments

Comments
 (0)