ydb-go-sdk
ydb-go-sdk copied to clipboard
bug: ydb_go_sdk_driver_conns metric does not clear old endpoints
Bug Report
YDB GO SDK version:
v3.101.0
Environment
linux, amd64
Current behavior:
when set of YDB dynnodes is changed, new endpoints are added to ydb_go_sdk_driver_conns metric, but the old ones, that are absent now, are not removed from it
Expected behavior:
ydb_go_sdk_driver_conns should list only endpoints, for which there is an alive connection in balancer connections pool
Steps to reproduce:
turn off one dynnode which is reported in ydb_go_sdk_driver_conns
Other information:
https://github.com/ydb-platform/ydb-go-sdk/blob/master/metrics/driver.go#L162
this code is not called, maybe because connections state is replaced on rediscovery here https://github.com/ydb-platform/ydb-go-sdk/blob/3074ad56386ccbcc0dc0b2f7cbe348bc01bb30f5/internal/balancer/balancer.go#L156 and Close() is not actually called