feat(healthcheck): HEALTH_TARGET_ADDRESS -> HEALTH_TARGET_ADDRESSES

- Specify fallback addresses
- Defaults changed from cloudflare:443 to cloudflare:443,github.com:443
- Startup check runs a parallel dial to each of the addresses specified with a global 6s timeout
- Full periodic check cycles through addresses as it fails and moves to retry
This commit is contained in:
Quentin McGaw
2025-11-19 15:41:21 +00:00
parent 03f1fea123
commit 482421dda3
7 changed files with 91 additions and 44 deletions

View File

@@ -18,11 +18,11 @@ func Test_Checker_fullcheck(t *testing.T) {
t.Parallel()
dialer := &net.Dialer{}
const address = "cloudflare.com:443"
addresses := []string{"badaddress:9876", "cloudflare.com:443", "google.com:443"}
checker := &Checker{
dialer: dialer,
tlsDialAddr: address,
dialer: dialer,
tlsDialAddrs: addresses,
}
canceledCtx, cancel := context.WithCancel(context.Background())
@@ -52,8 +52,8 @@ func Test_Checker_fullcheck(t *testing.T) {
dialer := &net.Dialer{}
checker := &Checker{
dialer: dialer,
tlsDialAddr: listeningAddress.String(),
dialer: dialer,
tlsDialAddrs: []string{listeningAddress.String()},
}
err = checker.fullPeriodicCheck(ctx)