Clean up health check dead code and timeout#4791
Merged
ChrisJBurns merged 1 commit intostacklok:mainfrom Apr 14, 2026
Merged
Conversation
10 tasks
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4791 +/- ##
==========================================
+ Coverage 68.90% 68.93% +0.02%
==========================================
Files 517 517
Lines 54803 54795 -8
==========================================
+ Hits 37764 37772 +8
+ Misses 14129 14117 -12
+ Partials 2910 2906 -4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
@gkatz2 oh, sorry, there is a conflict now, would you mind resolving it? The code looks good itself! |
The constructor and functional options guarantee positive values for healthCheckInterval and healthCheckPingTimeout, making two zero-value guards unreachable. The redundant context timeout in checkMCPStatus capped the configurable ping timeout at 5s; the MCPPinger already enforces its own timeout internally. Fixes stacklok#4790 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Greg Katz <gkatz@indeed.com>
948b70c to
c9fc505
Compare
Contributor
Author
|
@jhrozek, just pushed a fix for the conflict. |
jhrozek
approved these changes
Apr 13, 2026
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.
Summary
transparent_proxy.go— the constructor and functional options guarantee positive values, making these unreachable.context.WithTimeout(ctx, 5*time.Second)incheckMCPStatus— theMCPPingeralready enforces its own timeout internally (http.Client.Timeoutfor the transparent proxy pinger, non-blocking send for the httpsse pinger). The hardcoded 5s context timeout silently cappedTOOLHIVE_HEALTH_CHECK_PING_TIMEOUTat 5s.Fixes #4790
Type of change
Test plan
task test)task lint-fix)Special notes for reviewers
The redundant context timeout in
checkMCPStatusis removed rather than plumbed with the configured value. Both existingMCPPingerimplementations own their timeouts: the transparent proxy pinger setshttp.Client.Timeoutto the configured ping timeout, and the httpsse pinger is non-blocking (fire-and-forget channel send that returns immediately). TheHealthCheckerdoesn't need to duplicate timeout enforcement that the pinger already handles. The equivalent dead guard forretryDelaywas already removed in PR #4108 (commit a41f8a8).Generated with Claude Code