This repository has been archived by the owner on Mar 9, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 44
Conversation
This file contains 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
ghost
assigned Stebalien
Oct 23, 2018
Stebalien
added a commit
to ipfs/kubo
that referenced
this pull request
Oct 23, 2018
This fixes the data-race in the config. Depends on: ipfs/go-ipfs-config#16. This does not fix #4942 as there's still a logical race: parallel config updates clobber each other. However, we'll still need the Clone function for the new `--dry-run` flag introduced in #5455. License: MIT Signed-off-by: Steven Allen <[email protected]>
kevina
reviewed
Oct 29, 2018
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.
LGTM. I would add one more test though, just to be complete.
ghost
assigned magik6k
Nov 6, 2018
magik6k
approved these changes
Nov 6, 2018
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.
(pushed the test @kevina requested)
kevina
reviewed
Nov 6, 2018
config.go
Outdated
@@ -110,3 +110,19 @@ func ToMap(conf *Config) (map[string]interface{}, error) { | |||
} | |||
return m, nil | |||
} | |||
|
|||
// Clone copies the config. Use when when updating. |
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.
typo: remove the extra when
kevina
reviewed
Nov 6, 2018
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.
One typo in comment but otherwise LGTM
The user must call this before modifying the config. Given that the config contains slices/maps modifications can modified *shared* state, even after dereferencing.
(missed in my previous PR)
Stebalien
force-pushed
the
fix/thread-safety
branch
from
December 14, 2018 00:03
d951521
to
f3dab1b
Compare
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
The user must call this before modifying the config. Given that the config contains slices/maps modifications can modified shared state, even after dereferencing.
(also adds some tests I failed to commit in my Strings-type PR)