mirror of
https://github.com/tailscale/tailscale.git
synced 2026-11-26 03:26:26 -08:00
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]>