Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long time to establish first ping #1469

Closed
1 of 2 tasks
JulienMalka opened this issue May 18, 2023 · 2 comments
Closed
1 of 2 tasks

Long time to establish first ping #1469

JulienMalka opened this issue May 18, 2023 · 2 comments
Labels
bug Something isn't working stale

Comments

@JulienMalka
Copy link

JulienMalka commented May 18, 2023

Bug description

Whenever I try to initiate a connection with one of my machines, the first ping is always very slow, taking sometimes up to 10 seconds. After the first connection, I can ping instantly.
I am not sure this is a normal behaviour, as the connection is supposed to go through the DERP servers if a direct connection has not (yet) be made.
This is somewhat confirmed because if I run tailscale ping with a machine where connection has not yet been established I get

pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms
pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms
pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 7ms
pong from machine (fd7a:115c:a1e0::a) via DERP(par) in 3ms
pong from machine (fd7a:115c:a1e0::a) via ip:port in 0s

and it would seem that in this case the connection was made via DERP servers until a direct connection was made. Why is this not the case when I use the ping command or try to initiate a httpconnection ?

Environment

  • OS:
  • Headscale version:
  • Tailscale version:
  • Headscale is behind a (reverse) proxy
  • Headscale runs in a container

To Reproduce

@JulienMalka JulienMalka added the bug Something isn't working label May 18, 2023
armooo added a commit to armooo/headscale that referenced this issue May 27, 2023
This fixes juanfont#1469, where three bugs pervent main from existing on
SIGTERM.

The first two are blocking receiving from cancel chanels which never
have values sent to them, cancelStateUpdateChan and
cancelPolicyUpdateChan. It seems closing the chanels should be all the
is needed to signal the watching goroutines to exit.

The other is the signal hander never exiting an infinite for loop. The
sigFunc is called in an errorGroup which blocks exiting Serve and thus
main. It looks like a refactor in juanfont#1382 removed an os.Exit(0),
replacing it with a return breaks out of the loop.
armooo added a commit to armooo/headscale that referenced this issue Jun 10, 2023
This fixes juanfont#1469, where three bugs pervent main from existing on
SIGTERM.

The first two are blocking receiving from cancel chanels which never
have values sent to them, cancelStateUpdateChan and
cancelPolicyUpdateChan. It seems closing the chanels should be all the
is needed to signal the watching goroutines to exit.

The other is the signal hander never exiting an infinite for loop. The
sigFunc is called in an errorGroup which blocks exiting Serve and thus
main. It looks like a refactor in juanfont#1382 removed an os.Exit(0),
replacing it with a return breaks out of the loop.
kradalby pushed a commit to armooo/headscale that referenced this issue Jul 7, 2023
This fixes juanfont#1469, where three bugs pervent main from existing on
SIGTERM.

The first two are blocking receiving from cancel chanels which never
have values sent to them, cancelStateUpdateChan and
cancelPolicyUpdateChan. It seems closing the chanels should be all the
is needed to signal the watching goroutines to exit.

The other is the signal hander never exiting an infinite for loop. The
sigFunc is called in an errorGroup which blocks exiting Serve and thus
main. It looks like a refactor in juanfont#1382 removed an os.Exit(0),
replacing it with a return breaks out of the loop.
Copy link
Contributor

This issue is stale because it has been open for 180 days with no activity.

@github-actions github-actions bot added the stale label Nov 15, 2023
Copy link
Contributor

This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale
Projects
None yet
Development

No branches or pull requests

1 participant