-
Notifications
You must be signed in to change notification settings - Fork 99
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
sibling() is copying a sync.Mutex #600
Comments
@ktarplee Thanks for reporting this bug! Just to share some context: But this is still a coding bug. @ktarplee Would you be willing to contribute a fix? If not, me or someone else in the community can fix it. |
It looks like I would be happy to fix it but I am not 100% clear on the approach to take. I am just now porting code to use ORAS so I am no expert in how ORAS works yet. It seems me that you would want to preserve the ability to copy (or at least clone) |
Yeah I think we should provide a method to clone the |
I'll work on this. |
@ktarplee Thank you! I've assigned this to you. |
Closes #600 Signed-off-by: Kyle M. Tarplee <[email protected]>
Closes oras-project#600 Signed-off-by: Kyle M. Tarplee <[email protected]>
Closes #600 Signed-off-by: Kyle M. Tarplee <[email protected]>
The copylocks linter (via golangci-lint) pointed out that the code below, in repository.go makes a copy of the sync.Mutex in Repository.
The first line in this function make a copy of Repository and the Repository struct contains a field with type sync.Mutex so it is copied as well.
The documentation for sync.Mutex states clearly that making a copy after first use is not allowed so this does seem like a bug in ORAS.
It seems like this is an easy fix for someone who knows what the intent of
sibling()
is in the code base.The text was updated successfully, but these errors were encountered: