-
Notifications
You must be signed in to change notification settings - Fork 80
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
/usr/lib/sysimage/libdnf5/nevras.toml
empty after <ctrl-c>
#1753
Comments
The file is written in State::save() by this code:
The flaw is in libdnf5::utils::fs::File class. It directly writes to the named file instead of writing to a temporary file and then atomically renaming it to the given name. |
Atomically replacing a file might not be enough: State::save() writes into many files. An interruption could leave half of the files fully updated and the other half fully outdated. One would have to atomically replace whole directory (which is not portably supported by all file systems), or preserve old new new generation of the files in parallel so that next-excuted DNF can rollback when it discovers an unfinished update. |
I was running:
while true; do sudo dnf5 install -y ./htop-3.3.0-1.fc39.x86_64.rpm; sudo dnf5 remove htop -y; done
to debug a different issue and after hitting<ctrl-c>
/usr/lib/sysimage/libdnf5/nevras.toml
ended up empty.Following runs resulting in:
It likely requires "lucky" timing.
The text was updated successfully, but these errors were encountered: