Skip to content

Commit 311e63d

Browse files
feat: Shutdown channels which are removed from the EndpointPool after discovery calls. (#423)
1 parent 1904427 commit 311e63d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/Ydb.Sdk/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
- Shutdown channels which are removed from the EndpointPool after discovery calls.
12
- Fixed bug: Received message exceeds the maximum configured message size ([#421](https://github.com/ydb-platform/ydb-dotnet-sdk/issues/421)).
23
- Added `MaxSendMessageSize` \ `MaxReceiveMessageSize` grpc message size settings.
34
- Added `EnableMultipleHttp2Connections` setting to grpc channel.

src/Ydb.Sdk/src/Driver.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -163,13 +163,15 @@ private async Task<Status> DiscoverEndpoints()
163163
resultProto.Endpoints.Count, resultProto.SelfLocation, Config.SdkVersion
164164
);
165165

166-
_endpointPool.Reset(resultProto.Endpoints
167-
.Select(endpointSettings => new EndpointSettings(
168-
(int)endpointSettings.NodeId,
169-
(endpointSettings.Ssl ? "https://" : "http://") +
170-
endpointSettings.Address + ":" + endpointSettings.Port,
171-
endpointSettings.Location))
172-
.ToImmutableArray()
166+
await _channelPool.RemoveChannels(
167+
_endpointPool.Reset(resultProto.Endpoints
168+
.Select(endpointSettings => new EndpointSettings(
169+
(int)endpointSettings.NodeId,
170+
(endpointSettings.Ssl ? "https://" : "http://") +
171+
endpointSettings.Address + ":" + endpointSettings.Port,
172+
endpointSettings.Location))
173+
.ToImmutableArray()
174+
)
173175
);
174176

175177
return new Status(StatusCode.Success);

0 commit comments

Comments
 (0)