Fix VERBOSE level not registered in multiprocessing workers#546
Open
Fix VERBOSE level not registered in multiprocessing workers#546
Conversation
Signed-off-by: Sameer Chaturvedi <sameerc@mit.edu>
Member
|
yes, I was able to replicate it on a linux laptop: export REPO="git+https://github.com/mit-psfc/disruption-py"
this hinges on using with your fix, both work:
BUT it does not look like I can switch log level anymore with python 3.14 (!):
I read again the release notes for 3.14, but I could not see anything that might help.
|
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.
Summary
setup_logging()to module-level inlog_settings.py, so it's available in any process that imports the modulespawn) and Linux with Python 3.14+ (forkserver)Problem
The custom VERBOSE level and
logger.verbose()method are registered insidesetup_logging(), which only runs in the main process. Worker processes created bymultiprocessing.Pooldon't inherit this on:spawn)forktoforkserver)This causes
params.logger.verbose()in the physics method decorator (decorator.py:61) to throwAttributeError. The broadexceptinpopulate_methodcatches it and replaces the method's real result with NaN -- for every method, every shot.Verification
Tested with MAST shot 30420,
num_processes=1, macOS + Python 3.11 (spawn):dev: 0/33 parameters have data (100% NaN, every method errors withAttributeError)power_nbimissing for this shot)Greg also confirmed: dies on Linux + Python 3.14 (
forkserver), works from this branch.Test plan
spawn— all NaN ondev, real data on fix branchforkserver)References [edit by GLT]
https://docs.python.org/3/whatsnew/3.14.html#concurrent-futures