Skip to content

cmd/tailcat: return the relayed path when perf's path wait times out - #145

Open
sntxrr wants to merge 2 commits into
tailscale:mainfrom
sntxrr:perf-relayed-path
Open

sntxrr wants to merge 2 commits into
tailscale:mainfrom
sntxrr:perf-relayed-path

Conversation

@sntxrr

@sntxrr sntxrr commented Oct 3, 2026

Copy link
Copy Markdown

Fixes #144

waitForDirectPath returned 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-derp never 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/relayed forces a relayed-only path with TS_DEBUG_ALWAYS_USE_DERP=1 and a 2s timeout, and checks both --via-derp and the refusal without it. It fails without the fix.
  • the fix, 5 lines.

Testing: go build ./..., go test -count=1 -timeout 600s ./... and go vet ./... pass on linux/arm64 (golang:1.27). The relayed subtest also passed 3/3 with -count=3.

sntxrr added 2 commits October 3, 2026 14:48
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

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf: a relayed path always fails with "no reply to pings" when --timeout is a whole number of seconds (including the 10s default)

1 participant