Repository navigation
Add EPERM copy fallback - #5668
Merged
Merged
Conversation
Owner
|
I don't think we should change the copy-sync and move-sync because those aren't used at all. Thanks! |
Contributor
Author
|
That makes sense. I did some reading and it looks like pretty much everything the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brief summary
This PR adds a copy failure of EPERM fallback.
Which issue is fixed?
Fixes #5637
In-depth Description
This PR adds a fallback function when
copyFileSyncfails using node 24.I am not able to reproduce the original issue on my machines, and the issue seems specific to TrueNAS but there may also be other setups that have the same issue.
If an EPERM error is thrown when trying to copy the file, a 1 MB buffer is created to stream the source file to the destination file. I chose to stream through a buffer instead of just replacing with
writeFileSyncbecause that will load the entire file into memory before writing, which could cause issues when copying the database or other large files.The
renamefunction was also updated to attempt the streaming copy when anEPERMerror occurs.How have you tested this?
Created minimal tests to make sure the fallback works and ensured the server started correctly on Linux.
Because I cannot recreate the issue myself, this should probably be tested in
:edge.Screenshots
N/A