-
-
Notifications
You must be signed in to change notification settings - Fork 422
Copy package to destination if move failed during resource installation #1938
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
Merged
Conversation
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
3 tasks
@per1234
per1234
added
topic: code
Related to content of the project itself
type: imperfection
Perceived defect in any part of project
labels
Oct 22, 2022
cmaglie
cmaglie
approved these changes
Oct 24, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the patch and for the clear explanation, I never understood the reason for these random Access denied
errors, now it's clear!
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.
Please check if the PR fulfills these requirements
See how to contribute
before creating one)
our contributing guidelines
UPGRADING.md
has been updated with a migration guide (for breaking changes)What kind of change does this PR introduce?
This PR improves compatibility with antivirus software.
What is the current behavior?
CLI reports
if an antivirus software is still scanning temp files when CLI trys to move them to destination dir. This is a common error if you are using an antivirus software, and there are lots of discussion.
All previous suggestion is to disable antivirus temporarily. It's not a good solution because:
Some related issues, all suggested to solve manually:
core install
fails with "Access is denied" error #723What is the new behavior?
CLI will try to copy temp files if move failed, no error will be reported even if antivirus is scanning temp files.
To demonstrate new behavior, I've added debug logs in my demo and the output looks like:
Does this PR introduce a breaking change, and is titled accordingly?
No
Other information
Copy takes a little bit more time than move, but it's only called if move failed. And it's definitely faster and safer than searching for error message, disabling antivirus, and rerun installation.
Temp files will not be left permanently, they will be removed by
defer tempDir.RemoveAll()
here.