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

Update perms.WriteFile to write atomically #2063

Merged
merged 3 commits into from
Sep 22, 2023
Merged

Conversation

marun
Copy link
Contributor

@marun marun commented Sep 21, 2023

Why this should be merged

This ensures that files are written atomically to avoid readers from reading partial files. There have been recent flakes caused by the process context file not being written completely before being read by the testnet fixture.

How this works

  • update perms.WriteFile to write files atomically with renameio.WriteFile
    • on windows writing files atomically is not reliable and ioutil.WriteFile will be used instead
  • write process context file with perms.WriteFile

How this was tested

CI

@marun marun changed the title Update perms.WriteFile to use tailscale's atomicfile Update perms.WriteFile to write atomically Sep 21, 2023
@StephenButtolph StephenButtolph added this to the v1.10.11 milestone Sep 22, 2023
@StephenButtolph StephenButtolph added the testing This primarily focuses on testing label Sep 22, 2023
@StephenButtolph StephenButtolph added this pull request to the merge queue Sep 22, 2023
Merged via the queue into dev with commit d42c75f Sep 22, 2023
16 checks passed
@StephenButtolph StephenButtolph deleted the atomic-write-file branch September 22, 2023 02:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing This primarily focuses on testing
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants