Make v2/Plugin accesses safe.#29191
Merged
anusha-ragunathan merged 1 commit intomoby:masterfrom Dec 8, 2016
Merged
Conversation
aaronlehmann
reviewed
Dec 6, 2016
plugin/backend_linux.go
Outdated
aaronlehmann
reviewed
Dec 6, 2016
plugin/manager_linux.go
Outdated
There was a problem hiding this comment.
Shouldn't accesses to the cMap be protected by the mutex?
Contributor
Author
There was a problem hiding this comment.
Yes, updated.
aaronlehmann
reviewed
Dec 6, 2016
plugin/manager.go
Outdated
There was a problem hiding this comment.
Could v2.Plugin reference controllers directly (probably through an interface) instead of using this map keyed on pointer values?
aaronlehmann
reviewed
Dec 6, 2016
plugin/manager.go
Outdated
There was a problem hiding this comment.
I'd suggest unembedding this field, to unexport it. It's probably not good for other packages to be able to lock and unlock the mutex directly.
v2/Plugin struct had fields that were - purely used by the manager. - unsafely exposed without proper locking. This change fixes this, by moving relevant fields to the manager as well as making remaining fields as private and providing proper accessors for them. Signed-off-by: Anusha Ragunathan <anusha@docker.com>
1a2b49f to
b35490a
Compare
Member
|
/cc @vieux @tiborvass |
Contributor
|
LGTM |
1 similar comment
Contributor
|
LGTM |
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.
v2/Plugin struct had fields that were
This change fixes this, by moving relevant fields to the manager as well
as making remaining fields as private and providing proper accessors for
them.
Signed-off-by: Anusha Ragunathan anusha@docker.com