Skip to content

fix: keep unchanged nodes and connections on address-book refresh - #1764

Merged
Dosik13 merged 2 commits into
mainfrom
fix/preserve-node-connections-on-refresh
Jul 9, 2026
Merged

fix: keep unchanged nodes and connections on address-book refresh#1764
Dosik13 merged 2 commits into
mainfrom
fix/preserve-node-connections-on-refresh

Conversation

@Dosik13

@Dosik13 Dosik13 commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Description:

Fix the address-book refresh needlessly closing and recreating every consensus node's gRPC connection, even when the fetched address book is unchanged. The churn let in-flight requests race a connection close and fail pre-send with a non-retryable Canceled ("the client connection is closing").

  • Match existing nodes against the incoming address book by address and confirm the key, so an unchanged refresh keeps the current nodes
  • Skip re-adding nodes already present so their open connections are preserved and only removed or re-addressed nodes are closed
  • Add unit tests covering node and connection reuse across an unchanged refresh, using real consensus nodes since the managed-network mocks set key == address

Related issue(s):

Fixes #1762

Notes for reviewer:

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

Dosik13 added 2 commits July 7, 2026 15:17
Signed-off-by: dosi <dosi.kolev@limechain.tech>
Signed-off-by: dosi <dosi.kolev@limechain.tech>
@Dosik13
Dosik13 requested review from a team as code owners July 7, 2026 12:33
@Dosik13
Dosik13 requested a review from agadzhalov July 7, 2026 12:33
@lfdt-bot

lfdt-bot commented Jul 7, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@codecov

codecov Bot commented Jul 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
sdk/managed_network.go 100.00% <100.00%> (ø)

... and 5 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dosik13 Dosik13 moved this from 📋 Backlog to 👀 In Review in Hiero SDK Sprint Board Jul 8, 2026

@gsstoykov gsstoykov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Dosik13
Dosik13 merged commit 4724990 into main Jul 9, 2026
16 checks passed
@Dosik13
Dosik13 deleted the fix/preserve-node-connections-on-refresh branch July 9, 2026 08:37
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.

Address-book refresh closes all consensus-node connections even when unchanged, failing in-flight requests with non-retryable Canceled

3 participants