-
Notifications
You must be signed in to change notification settings - Fork 78
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
avoid text file busy error on track #2494
base: main
Are you sure you want to change the base?
Conversation
} | ||
if err := os.Chmod(pluginPath, constants.DefaultPerms755); err != nil { | ||
return err | ||
if !utils.IsExecutable(pluginPath) { |
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.
Should we be checking if the file exists before creating a new copy, and then checking if it's not already executable before doing the chmod?
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.
If the file exists and is not executable it is sign of a problem in the previous setup. It can be a partial copy for
example. So probably it is best to copy it again.
Also, if it is not executable, there is not risk of encountering text file busy
error during copy
because that happens when the binary is being executed.
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.
Gotcha, could you add a comment explaining that context here? 🙏
} | ||
if err := os.Chmod(pluginPath, constants.DefaultPerms755); err != nil { | ||
return err | ||
if !utils.IsExecutable(pluginPath) { |
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.
Can we make a unit for these code paths?
Why this should be merged
Closes #2465
How this works
How this was tested
How is this documented