Files
tailscale/net
Nick Khyl 65c4e36477 net/dns: retry failed hosts file updates in the background on Windows
Replacing the hosts file fails with a sharing violation while another
process, such as the DNS Client service or antivirus software, has it
open. Previously, we retried for about 50ms and then failed SetDNS as
a whole.

In this PR, we move hosts file updates to a CoalescedOp that retries
a failed write with backoff for up to 30 seconds, picking
up newer entries if SetDNS is called again in the meantime. A failure
is logged and no longer fails SetDNS.

Close waits for the entries to be removed.

Fixes #21035
Updates #21001
Updates #5753
Updates #8161
Updates #21617
Updates #14327
Updates tailscale/corp#52076

Signed-off-by: Nick Khyl <[email protected]>
2026-11-23 12:48:28 -08:00
..
2026-07-10 17:39:16 -07:00
2026-11-12 10:15:41 +01:00