Skip to content

Conversation

@kradalby
Copy link
Collaborator

This commit changes the example config and default time for
how often we refresh the DERP map. If not changed, this
is typically Tailscales official map.

Second commit makes updating of the DERP map from file and url
more robust by retrying with exponential backoff if it fails
and upon failure, keep the old DERP map if we cannot successfully
build a new one.

This commit changes the example config and default time for
how often we refresh the DERP map. If not changed, this
is typically Tailscales official map.

Signed-off-by: Kristoffer Dalby <[email protected]>
}

return derpMap
rand.Shuffle(len(region.Nodes), func(i, j int) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to make this deterministic per Tailnet?

This helps spread the load across nodes in a DERP region.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it will try to use the base_domain as a seed so it should be relatively stable per headscale.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, thanks!

This commits makes updating of the DERP map from file and url
more robust by retrying with exponential backoff if it fails
and upon failure, keep the old DERP map if we cannot successfully
build a new one.

Fixes juanfont#2694

Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Signed-off-by: Kristoffer Dalby <[email protected]>
Avoid that all headscale clients picks the same first
node in a region.

Signed-off-by: Kristoffer Dalby <[email protected]>
@kradalby kradalby force-pushed the kradalby/derp-times branch from b7234f9 to 0c8765c Compare August 21, 2025 15:02
@kradalby kradalby merged commit b875676 into juanfont:main Aug 22, 2025
78 of 84 checks passed
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.

3 participants