Skip to content

Conversation

chlins
Copy link
Member

@chlins chlins commented Aug 8, 2025

This pull request removes the custom gRPC seed peer resolver implementation and its related usage from the codebase. The main impact is a simplification of the client connection logic for seed peers, as well as the cleanup of related interfaces and mock methods. The changes affect several packages, including the scheduler configuration and RPC client modules.

Removal of custom gRPC resolver and related logic

  • Deleted the entire pkg/resolver/seed_peer_resolver.go file, which previously implemented a custom gRPC resolver for seed peers. This includes the resolver registration, address resolution, and notification logic.
  • Removed the GetResolveSeedPeerAddrs method from the DynconfigInterface in scheduler/config/dynconfig.go, along with its implementation and associated imports. This method was used to provide dynamic addresses for the custom resolver. [1] [2] [3]
  • Deleted the usage of the custom resolver and balancer registration from the GetClient and GetV2 methods in pkg/rpc/cdnsystem/client/client.go and pkg/rpc/dfdaemon/client/client_v2.go, simplifying the client creation logic. [1] [2] [3]
  • Removed the mock methods for GetResolveSeedPeerAddrs from the generated mock for DynconfigInterface in scheduler/config/mocks/dynconfig_mock.go. [1] [2]

Miscellaneous cleanup

  • Removed the unused helper function GetSeedPeerClusterConfigBySeedPeer from scheduler/config/dynconfig.go, further simplifying the configuration code.

Description

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@chlins chlins added the enhancement New feature or request label Aug 8, 2025
@chlins chlins enabled auto-merge (squash) August 8, 2025 06:43
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 32.61%. Comparing base (bd2ae63) to head (3aef3bf).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
scheduler/config/dynconfig.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #4259      +/-   ##
==========================================
+ Coverage   32.42%   32.61%   +0.19%     
==========================================
  Files         350      349       -1     
  Lines       41630    41363     -267     
==========================================
- Hits        13497    13492       -5     
+ Misses      27257    26993     -264     
- Partials      876      878       +2     
Flag Coverage Δ
unittests 32.61% <0.00%> (+0.19%) ⬆️

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

Files with missing lines Coverage Δ
pkg/rpc/cdnsystem/client/client.go 63.15% <ø> (+26.79%) ⬆️
pkg/rpc/dfdaemon/client/client_v2.go 0.00% <ø> (ø)
scheduler/config/mocks/dynconfig_mock.go 35.10% <ø> (+12.02%) ⬆️
scheduler/config/dynconfig.go 32.82% <0.00%> (+13.69%) ⬆️

... and 2 files with indirect coverage changes

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

Signed-off-by: chlins <chlins.zhang@gmail.com>
@chlins chlins force-pushed the refactor/remove-unused-codes branch from d36f593 to 3aef3bf Compare August 8, 2025 07:43
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@LunaWhispers LunaWhispers left a comment

Choose a reason for hiding this comment

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

lgtm

@chlins chlins merged commit 1a87bfc into main Aug 8, 2025
16 checks passed
@chlins chlins deleted the refactor/remove-unused-codes branch August 8, 2025 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants