Skip to content

fix: download plugin to temp file first, then atomically replace - #15

Open
KujouMolean wants to merge 1 commit into
NewAmazingPVP:mainfrom
KujouMolean:main
Open

fix: download plugin to temp file first, then atomically replace#15
KujouMolean wants to merge 1 commit into
NewAmazingPVP:mainfrom
KujouMolean:main

Conversation

@KujouMolean

Copy link
Copy Markdown

Previously the download wrote directly to the target JAR file. If the server restarted or crashed during the download, the plugin would be corrupted (half-written JAR). Now we write to a .tmp file first, and only after a successful download do an atomic move to the target path. On failure the temp file is cleaned up, leaving the original plugin intact.

Previously the download wrote directly to the target JAR file. If the
server restarted or crashed during the download, the plugin would be
corrupted (half-written JAR). Now we write to a .tmp file first, and
only after a successful download do an atomic move to the target path.
On failure the temp file is cleaned up, leaving the original plugin intact.
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