Skip to content

Drain gRPC channels removed by endpoint discovery - #950

Open
vgvoleg wants to merge 1 commit into
mainfrom
discovery-channel-shutdown-timeout
Open

vgvoleg wants to merge 1 commit into
mainfrom
discovery-channel-shutdown-timeout

Conversation

@vgvoleg

@vgvoleg vgvoleg commented Nov 26, 2026

Copy link
Copy Markdown
Member

When a successful discovery response drops an endpoint, both drivers remove its channel from routing immediately and let active RPCs finish in the background. Active streams count until gRPC completes them. The driver closes the channel at the deadline and reports interrupted calls as connection loss.

grpc_channel_shutdown_timeout defaults to 60 seconds. Set it to 0 to close removed channels immediately. If discovery reuses an address with a different node ID, the replacement channel opens a fresh transport.

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.03922% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.46%. Comparing base (51f8d84) to head (3804f32).

Files with missing lines Patch % Lines
ydb/aio/connection.py 92.85% 0 Missing and 4 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #950      +/-   ##
==========================================
+ Coverage   84.16%   84.46%   +0.29%     
==========================================
  Files         102      102              
  Lines       13974    14101     +127     
  Branches     1450     1479      +29     
==========================================
+ Hits        11761    11910     +149     
+ Misses       1758     1741      -17     
+ Partials      455      450       -5     
Flag Coverage Δ
integration 79.93% <66.17%> (-0.27%) ⬇️
unit 57.03% <94.60%> (+3.92%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ydb/aio/pool.py 84.26% <100.00%> (+4.43%) ⬆️
ydb/connection.py 86.20% <100.00%> (+5.28%) ⬆️
ydb/driver.py 72.46% <100.00%> (+0.82%) ⬆️
ydb/pool.py 90.93% <100.00%> (+1.04%) ⬆️
ydb/aio/connection.py 93.04% <92.85%> (+3.39%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vgvoleg
vgvoleg force-pushed the discovery-channel-shutdown-timeout branch from ee4affd to 3804f32 Compare November 27, 2026 09:28

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant