-
-
Notifications
You must be signed in to change notification settings - Fork 26.6k
ENH Makes global configuration thread local #18736
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
+81
−8
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
011c8d2
TST Adds failing test
thomasjpfan 59b4a8e
ENH Makes copies of global configuration per thread
thomasjpfan f6a1357
TST Skip loky tests for joblib version < 0.12
thomasjpfan bddc33f
Merge remote-tracking branch 'upstream/master' into thread_safe_config
thomasjpfan e7de9a0
Merge remote-tracking branch 'upstream/master' into thread_safe_config
thomasjpfan 02e738f
Merge remote-tracking branch 'upstream/master' into thread_safe_config
thomasjpfan 99a4ce1
ENH Small refactor
thomasjpfan 966498d
DOC Update docstring of test
thomasjpfan df291d9
DOC Update names
thomasjpfan bba6465
Merge remote-tracking branch 'upstream/main' into thread_safe_config
thomasjpfan ba93b54
DOC Updates changelog and docstring about threadsafeness
thomasjpfan ea516c4
DOC Update test's docstring
thomasjpfan 6fe0619
ENH Cleaner code
thomasjpfan 91d18c1
DOC Better docstring
thomasjpfan 8e733cb
Merge remote-tracking branch 'upstream/main' into thread_safe_config
thomasjpfan 276c720
WIP Fixes merge error
thomasjpfan 1b28965
CLN Less lines of code
thomasjpfan 319f007
CLN Better copy logic
thomasjpfan 450a456
CLN Do not need copy in config_context
thomasjpfan 957b3c0
DOC Adds comment about mutable
thomasjpfan 4b89c6f
Merge remote-tracking branch 'upstream/main' into thread_safe_config
thomasjpfan 8ef81f7
DOC Adds comment for copy
thomasjpfan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.
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.
just a nitpick. Why not put that directly in get_config ?
also I think the copy is unecessary here since there will be a copy afterwards anyway
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.
I thought of
_get_threadlocal_configfor returning a threadlocal mutable version of the config, whileget_configreturns a immutable copy of the config. This is a safe guard from someone doing the following:which is consistent with the current behavior on
main.I added comments to describe this reasoning into the PR.
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.
But do we intend to use
_get_threadlocal_configoutside ofget_config? If not why don't we doThere 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.
_get_threadlocal_configis used inset_configto update the threadlocal config.In any case, for
set_configto not mutable_global_config,_threadlocal.global_configneeds to be initialize with a copy of_global_config.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.
Yep missed that. Sorry. Forget my comments :)