• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 24240677305

10 Apr 2026 11:26AM UTC coverage: 65.181% (-0.02%) from 65.197%
24240677305

push

github

web-flow
Make transparent proxy health check parameters configurable (#4108)

* Make transparent proxy health check parameters configurable

The health check ping timeout, retry delay, and failure threshold
were hardcoded, making it impossible to tune resilience for
environments with transient network disruptions. Only the check
interval was configurable via TOOLHIVE_HEALTH_CHECK_INTERVAL.

Add three new environment variables following the same pattern:
TOOLHIVE_HEALTH_CHECK_PING_TIMEOUT, TOOLHIVE_HEALTH_CHECK_RETRY_DELAY,
and TOOLHIVE_HEALTH_CHECK_FAILURE_THRESHOLD. Raise the default failure
threshold from 3 to 5 to extend the tolerance window from ~40s to ~60s,
reducing false positives without significantly delaying detection of
genuinely dead servers.

Fixes #4084

Signed-off-by: Greg Katz <gkatz@indeed.com>

* Retrigger CI

Signed-off-by: Greg Katz <gkatz@indeed.com>

* Address review feedback: test hermeticity and doc accuracy

- Always set env vars in getter tests (including empty string for
  default cases) so tests are hermetic against ambient environment
- Clear all health check env vars in TestNewTransparentProxyDefaultValues
- Fix failure window formula in docs to match actual behavior
- Remove reference to not-yet-merged env var name in docs

Signed-off-by: Greg Katz <gkatz@indeed.com>

* Address review feedback from amirejaz

- Fix failure window estimate: 70s → 60s to match the formula
- Document threshold=1 behavior (immediate shutdown, no retries)
- Note that pingTimeout > interval extends the failure window
- Remove pre-existing dead code: retryDelay == 0 guard was
  unreachable before this PR (constructor always set a positive
  value via DefaultHealthCheckRetryDelay)
- Fix test hermeticity: isolate env vars in option function test

Signed-off-by: Greg Katz <gkatz@indeed.com>

---------

Signed-off-by: Greg Katz <gkatz@indeed.com>

59 of 59 new or added lines in 1 file covered. (100.0%)

41 existing lines in 6 files now uncovered.

56870 of 87249 relevant lines covered (65.18%)

60.51 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.38
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc