Conversation
With TS_DEBUG_ALWAYS_USE_DERP on the client and a whole-second --timeout, perf --via-derp should run over the relay, and perf without it should refuse with "no direct path". Both currently fail with "no reply to pings after 2s". Signed-off-by: Don O'Neill <sntxrr+github@gmail.com>
waitForDirectPath returned a non-direct path only when under 0.5s of its timeout remained. Pongs arrive in milliseconds, so with a whole-second --timeout (the 10s default included) the last ping saw about 1s left, slept past the deadline, and the next one failed as "no reply to pings". A path that stayed relayed never came back: --via-derp never ran a test, and without it the "no direct path" refusal was never shown. Keep the last path measured and return it at the deadline, as the function's doc comment already says. "No reply to pings" is now only reported when nothing replied. Fixes tailscale#144 Signed-off-by: Don O'Neill <sntxrr+github@gmail.com>
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.
Fixes #144
waitForDirectPathreturned a non-direct path only when under 0.5s of its timeout remained. With a whole-second--timeout(the 10s default included), the last ping saw about 1s left, slept past the deadline, and failed as "no reply to pings". A path that stayed relayed never came back, so--via-derpnever ran a test and the "no direct path" refusal was never shown.It now keeps the last path measured and returns it at the deadline, as its doc comment says.
Two commits:
TestPerf/relayedforces a relayed-only path withTS_DEBUG_ALWAYS_USE_DERP=1and a 2s timeout, and checks both--via-derpand the refusal without it. It fails without the fix.Testing:
go build ./...,go test -count=1 -timeout 600s ./...andgo vet ./...pass on linux/arm64 (golang:1.27). The relayed subtest also passed 3/3 with-count=3.