Skip to content

feat: write controller.conf atomically#88

Open
SimonRichardson wants to merge 2 commits intojuju:4.0from
SimonRichardson:write-file-atomically
Open

feat: write controller.conf atomically#88
SimonRichardson wants to merge 2 commits intojuju:4.0from
SimonRichardson:write-file-atomically

Conversation

@SimonRichardson
Copy link
Copy Markdown
Member

It's possible to corrupt the controller config file if there is an exception during writing of the file. Instead, we want to only update the controller config atomically. This involves writing the yaml to a temp file and then do a atomic file replace (POSIX). This ensures that it will always be valid if the data is valid.

@SimonRichardson SimonRichardson changed the title feat: write controller config atomically feat: write controller.conf atomically Aug 7, 2025
Comment thread src/charm.py Outdated
@SimonRichardson SimonRichardson changed the base branch from main to 4.0 November 20, 2025 15:22
It's possible to corrupt the controller config file if there is an
exception during writing of the file. Instead, we want to only update
the controller config atomically. This involves writing the yaml to
a temp file and then do a atomic file replace (POSIX). This ensures
that it will always be valid if the data is valid.
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.

2 participants