fix: keep health check when proxy group is named default - #3165
Open
soffchen wants to merge 1 commit into
Open
Conversation
The reserved compatible provider uses the name "default" for GLOBAL. proxy-providers named default are rejected, but a proxy-group of the same name still registers its compatible provider in providersMap. parseProxies then overwrote that entry with the reserved provider (empty URL, interval 0). loadProvider only Initial()s map entries, so fallback/url-test interval never started and the group stayed on the first node until a manual delay test. Keep the group's provider in the map and still attach the reserved provider to GLOBAL.
Collaborator
|
This is essentially an implementation oversight; users shouldn't be allowed to define a group named "default". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A
fallback/url-test/load-balanceproxy group nameddefaultnever runs its periodic health check. Traffic stays on the first node until someone triggers a manual delay test.This was found on a gateway running Mihomo Meta v1.19.30: a
fallbackgroup nameddefaultwithinterval: 30did not URL-test for hours. After a restart it still selected the first node with empty delay history.GET /group/default/delayimmediately marked dead nodes and switched. Renaming the group toproxymade the 30s ticker start on boot.proxy-providerscannot be nameddefault(ReservedName), but a proxy-group of the same name is allowed.ParseProxyGroupregisters that group's compatible provider (withurl/interval) asprovidersMap["default"].parseProxiesthen overwrites the map entry with the reserved compatible provider used byGLOBAL(url == "",interval == 0).loadProvideronlyInitial()s map entries, so the group's health-check goroutine never starts. Untested nodes are treated as alive, so fallback sticks to the first member.Change
Create the reserved provider for
GLOBALas before. If a user group already claimedprovidersMap["default"], keep that entry and only attach the reserved provider toGLOBAL. Configs without a group nameddefaultare unchanged.Reproduction
After startup,
GET /providers/proxies/defaultshows an emptytestUrland the reserved all-outbound list, not the group's members. Delay history stays empty until a manual group delay test.Validation