feat(health): Configurable tunnel health monitoring and reconnect thresholds (#44) - #45
Open
Vonarian wants to merge 7 commits into
Open
feat(health): Configurable tunnel health monitoring and reconnect thresholds (#44)#45Vonarian wants to merge 7 commits into
Vonarian wants to merge 7 commits into
Conversation
… thresholds (closes CluvexStudio#44)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds configurable, continuous tunnel health monitoring (with timeouts and failure thresholds) and integrates it into MASQUE, WireGuard, and warp-in-warp runtimes, while also refining logging verbosity controls.
Changes:
- Added
HealthConfig+ background health monitor task that periodically probes a configurable HTTP URL and triggers failure on consecutive probe errors. - Wired the health monitor into tunnel run loops via
tokio::select!and exposed config via CLI/env (--health-*,AETHER_HEALTH_*), plus unified--reconnect-secsfor MASQUE and WireGuard. - Adjusted several hot-path logs from
debugtotraceand introducedAETHER_LOG/--log-level+ multi-level-vverbosity parsing.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| aether/src/wireguard.rs | Reduces noise by downgrading encapsulation/decapsulation errors to trace. |
| aether/src/tunnelping.rs | Introduces probe target parsing, health config/env wiring, and the background health monitor + tests. |
| aether/src/quic.rs | Downgrades verbose per-packet logs to trace to reduce default log volume. |
| aether/src/noize.rs | Downgrades obfuscation send logs to trace to reduce default log volume. |
| aether/src/masque_h2.rs | Downgrades capsule send/parse logs to trace. |
| aether/src/main.rs | Integrates the health monitor into MASQUE/WireGuard/warp-in-warp lifecycles and switches logging init to AETHER_LOG. |
| aether/src/cli.rs | Adds health-monitoring CLI flags, new logging flags, and unit tests for env/arg parsing. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…sing, and test env cleanup
Contributor
Author
|
Addressed PR review feedback in commit
|
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.
Resolves #44
Summary of Changes
Configurable Health Monitoring Flags:
--health-interval <n>(AETHER_HEALTH_INTERVAL, default20s): Controls continuous background check frequency. Set to0to disable.--health-fails <n>(AETHER_HEALTH_MAX_FAILS, default2): Maximum consecutive failed probes before declaring tunnel dead and initiating reconnect.--health-timeout <n>(AETHER_HEALTH_TIMEOUT, default5s): Timeout per health probe check.--health-url <url>(AETHER_HEALTH_PROBE_URL, defaulthttp://www.gstatic.com/generate_204): Custom health probe URL.--reconnect-secs <n>(AETHER_MASQUE_RECONNECT_SECS/AETHER_WG_RECONNECT_SECS, default2s): Reconnect delay after tunnel exit or failure.Observatory-Style Health Monitor:
tunnelping.rsthat probes activenetstackinstances periodically.[+] tunnel health check passed (rtt 142ms)).consecutive_fails >= max_fails.Integration:
run_masque_tunnel,run_wireguard_tunnel, andrun_warp_in_warpviatokio::select!.