Skip to content

Conversation

@EliteTK
Copy link

@EliteTK EliteTK commented Jan 21, 2026

Since the installer script uses mktemp -d to create a directory to store the downloaded release and extract it, the files might end up on a different filesystem than the target installation directory. This means that the mv basically turns into a cp followed by an rm which means that if it gets interrupted at this point, the result could be a partially written file, or just in general an installation with only some of the files written.

There's no real way to solve this without support from the filesystem, so instead this PR aims to reduce the window in these cases by first using mv to copy/move the files into a subdirectory of the target and then mv the files out. The second round of mv should just be rename under the hood so this should happen quickly. As an additional side effect, while you might end up with a partial upgrade, you will never end up with a partially written binary.

Also, since the temporary directory creation was successful, this means that the final round of mv is likely to also be successful as both require the same permissions to the parent directory.

This defers moving the new files until after they're definitely on the
same filesystem as the target directory to reduce the window during
which an interrupted installation could cause a partial update.
@EliteTK EliteTK force-pushed the reduce-interruption-risk branch from b40cdc9 to 3d4e033 Compare January 30, 2026 09:11
@EliteTK EliteTK marked this pull request as ready for review January 30, 2026 09:12
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.

1 participant