Skip to content

feat(outbound): fixed_fallback support (#1009) - #1

Open
itoywh wants to merge 7 commits into
kdaefrom
pr/1009-fixed-fallback
Open

itoywh wants to merge 7 commits into
kdaefrom
pr/1009-fixed-fallback

Conversation

@itoywh

@itoywh itoywh commented Jul 20, 2026

Copy link
Copy Markdown
Owner

来源

从 daeuniverse/dae 官方 PR #1009 迁移至自维护库 itoywh/kdae(官方合并无望,转为自用)。

功能

为 dialer_group 增加 fixed_fallback 选路策略:主节点死亡时立即回退到备用节点,并通过后台 goroutine 独立探活恢复,消除 reload 造成的瞬时断流。

包含 commit

  • 初始集成(dialer_group / connectivity_check / selection_policy)
  • [H1] 启动告警:retries>0 但 check_interval=0
  • [H2] dialer Done() 时退出 retry goroutine(reload/shutdown 安全)
  • [M1] 跟踪探活 networkType,消除 partial-death 抖动
  • [M2] 允许 retries=0(立即永久回退)
  • [M3] doFallback switch default 分支告警未处理 policy
  • gofmt 清理

影响文件

component/outbound/dialer_group.go, connectivity_check.go, dialer_selection_policy.go, dialer.go, common/consts/dialer.go, control/control_plane.go, .github/workflows/*

LiYang and others added 7 commits July 20, 2026 17:43
Port fixed_fallback selection policy from itoywh/dae PR #1009 (canonical
diff fee4c86...b68fd9f0) onto the olicesx/dae kdae (3.0) codebase.

- common/consts/dialer.go: add DialerSelectionPolicy_FixedWithFallback
- component/outbound/dialer_selection_policy.go: parse fixed_fallback
  (index[,timeout[,retries[,fallback_policy]]]) with unit-aware duration
- component/outbound/dialer/connectivity_check.go: AliveForRetry (mirror
  DNS-UDP to same-family TCP when no udp_check_dns), dynamic CheckOpts build
  (only probe configured targets, skip IPv6 when only IPv4 given),
  check_interval==0 disables probing, Node became DEAD/ALIVE logging,
  stuck-probe timeout
- component/outbound/dialer_group.go: FixedWithFallback select path,
  background runFixedFallbackRetry goroutine (timeout x retries, <2s clamp),
  alive-transition-callback driven start, rate-limited fallback logging
- control/control_plane.go: warn when health check is disabled
  (check_interval==0) or has no probe target
- .github/workflows/build.yml + seed-build.yml: self-contained build
  (drop ci-seed-jobs pre/post-actions, restrict matrix to amd64+arm64)
… check_interval=0

Surfaces the policy-specific misconfiguration: if a fixed_fallback policy asks for
retries>0 but the global health check is disabled (check_interval==0), the background
retry probes are silently dropped (aliveBackground returns early when CheckInterval==0),
so the node falls back permanently on first failure. Native #1009 sub-feature.
…e() (reload/shutdown)

runFixedFallbackRetry now returns on the dialer's Done() channel instead of blocking
until retries are exhausted, so a dae shutdown or a reload that replaces the dialer
no longer leaves the probing goroutine dangling. Adds exported Dialer.Done() (dialer.go).
Native #1009 sub-feature.
…partial-death jitter

Track the networkType the retry goroutine is probing (fixedFallbackNt). A select on a
different networkType (partial node death, e.g. TCP alive / UDP dead) no longer resets
that networkType's retry state, which previously caused log jitter and prevented the
goroutine from settling. Native #1009 sub-feature.
…nt fallback)

retries=0 is now valid = give up immediately, no background retry, matching the canonical
'retries<=0 = do not retry' semantics. Parser now rejects <0 only (default still 3).
Native #1009 sub-feature.
…h warns on unhandled policy

Add a default branch to the doFallback switch that warns on an unhandled FallbackPolicy
instead of silently returning ErrNoAliveDialer, so future policies are surfaced, not
mysteriously dropped. Native #1009 sub-feature.
…rden commit)

The harden fixed_fallback commit (e3e3ec2) left dialer_group.go with a
gofmt formatting deviation at the AliveForRetry wiring, which made the
CI Lint job fail on every subsequent build. Reformat to clear the debt
so the Lint job passes.
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