Repository navigation
Probe DNS, HTTP and TCP targets concurrently - #179
Open
abhiishek340 wants to merge 1 commit into
Open
abhiishek340 wants to merge 1 commit into
abhiishek340 wants to merge 1 commit into
Conversation
checkTargets ran every configured probe one after another, so /check took the sum of all probe timeouts. With the default 500ms per-target timeout, two unreachable targets already add up to the 1s CheckTimeout peers allow, so every peer's call fails with "context deadline exceeded" and the UI shows all nodes as unhealthy. Run the probes concurrently instead, so the time spent is that of the slowest single probe. Results keep their previous order per host. Fixes bloomberg#144 Signed-off-by: Abhishek Yadav <[email protected]>
This branch has not been deployed
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.
Issue number of the reported bug or feature request: #144
Describe your changes
checkTargetsran every configured DNS/HTTP/TCP probe one after another, so/checktook the sum of all probe timeouts. With the default 500ms per-target timeout, two unreachable targets already add up to the 1sCheckTimeoutpeers allow for/check. Every peer's call then fails withcontext deadline exceeded, and the UI shows all nodes as unhealthy. This matches the report in #144: one dead target is fine, two or more break the UI.This change runs the probes concurrently, so
/checktakes as long as the slowest single probe. Each goroutine writes only to its own preallocated slot. Results are then assembled in the same order as before (per host: dns, http, tcp), so the response shape is unchanged. The probe table now has a namedtargetProbetype, and the fan-out lives inrunTargetProbes.Testing performed
TestCheckTargetsProbesConcurrently: four HTTP targets that never answer within a 200ms timeout must all be checked in under 400ms, and each must report an error.checking 4 unreachable targets took 804.792417ms, want less than 400ms.TestCheckTargetsKeepsProtocolOrder: a host configured for all three protocols still gets its results in dns, http, tcp order.go test -race ./pkg/...passes.make bin/goldpingerbuilds.Additional context
#178 also touches the probe loop in
checkTargets(it adds metrics for external targets). If that PR lands first, I'm happy to rebase this one onto it.