Enhance dynconfig with local fallback, static addresses, and health checks (#1944)
- feat(dynconfig): support local file fallback when manager not configured
- Make
managerconfig optional; use local file fallback when absent- Extract remote (manager) logic into
remote.rsand add newlocal.rsfor file-based dynconfig with DNS scheduler discovery- Introduce
Sourceenum to dispatch between remote and local refresh- Local source reads
dynconfig.yamlfrom config dir, resolves schedulers via DNS, and controls its own refresh interval- Add
serde_yamlandhumantime-serdedependencies for local configSigned-off-by: Gaius gaius.qi@gmail.com
- feat(dynconfig): add static scheduler addrs and default config gen
- Add
addrsfield toSchedulerConfigfor static IP list; takes precedence over DNS-basedaddrwhen non-empty- Add
parse_schedulersto resolve static addresses, deduplicating and sorting for stable selection- Add
generate_default_if_absentto write default config file if none exists; called during initialization- Derive
Serializeon config types to support YAML generation- Add tests covering static addrs, precedence, invalid input, and default file generation
Signed-off-by: Gaius gaius.qi@gmail.com
- refactor(dynconfig): rename Source to Backend, expose path as CLI arg
- Rename
Sourceenum toBackendand update all references/comments- Move default helpers (
refresh_interval,scheduler_addr) todragonfly_client_config::dfdaemonfor broader reuse- Add
--dynconfigCLI arg (with env var) instead of deriving path from config file location- Rename
generate_default_if_absenttogenerate_defaultand update test names for clarity- Remove
DEFAULT_DYNCONFIG_FILENAMEconstant; adddefault_dfdaemon_dynconfig_path()to config crateSigned-off-by: Gaius gaius.qi@gmail.com
- fix(dynconfig): change scheduler addrs field from Vec to Option
- Change
addrsfield type fromVec<String>toOption<Vec<String>>- Default value is now
Noneinstead of emptyVec- Update match logic to fall back to DNS resolution when
addrsisNoneor empty- Update serde skip condition accordingly
Signed-off-by: Gaius gaius.qi@gmail.com
- refactor(dynconfig): rename
LocalConfig/SchedulerConfigtoConfig/`Scheduler
- Rename
LocalConfig→ConfigandSchedulerConfig→Schedulerinlocal.rs- Alias
Schedulerfrom manager API asManagerSchedulerto avoid name clash- Update all internal usages, defaults, and test assertions accordingly
Signed-off-by: Gaius gaius.qi@gmail.com
- refactor(dynconfig): move empty addr check to caller, add skip_serializing_if
- Move empty
addrcheck fromresolve_schedulersto its call site- Add
skip_serializing_if = "Option::is_none"toskip_verifyandcafields- Clarify comments for
client_configandseed_client_configfields- Minor formatting fixes (blank lines)
Signed-off-by: Gaius gaius.qi@gmail.com
- feat(dynconfig): add scheduler health check filtering in local backend
- Perform health checks on schedulers in local backend, filtering out unhealthy ones
- Return error if no healthy schedulers are available after filtering
- Increase default local dynconfig refresh interval from 5s to 60s
- Pass
DfdaemonConfigtoLocalto access TLS settings for health checks- Add tests for unhealthy scheduler filtering and failure cases
- Refactor
Dynconfig::newto extractbackend()helper; switch to interval-based refresh loopSigned-off-by: Gaius gaius.qi@gmail.com
- refactor(grpc): pass Manager reference directly to ManagerClient::new
- Replace
Arc<Config>with&ManagerinManagerClient::newsignature- Remove indirection through
config.manageroption unwrap- Call
config.load_client_tls_configdirectly on theManagerref- Update call site and tests accordingly
Signed-off-by: Gaius gaius.qi@gmail.com
- style: use inline format args in dynconfig local tests
Replace positional
{}placeholders with inline variable references informat!calls, improving readability and reducing argument lists.Signed-off-by: Gaius gaius.qi@gmail.com
Signed-off-by: Gaius gaius.qi@gmail.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802047560号
Dragonfly Client
Dragonfly client written in Rust. It can serve as both a peer and a seed peer.
Documentation
You can find the full documentation on the d7y.io.
Community
Join the conversation and help the community grow. Here are the ways to get involved:
22880028764Contributing
You should check out our CONTRIBUTING and develop the project together.