Fix intermittent crash with multiprocessing-aware logging#89
Fix intermittent crash with multiprocessing-aware logging#89JoeZiminski merged 15 commits intoneuroinformatics-unit:mainfrom
Conversation
|
Thanks for this @AlgoFoe! Could you please send the code you used to test locally? I'll have a quick playaround! If I understand correctly this will skip setting up multiprocessing in the MainProcess such that when |
Thanks for the review @JoeZiminski! You are completely right. I tested it locally on Windows, and with my proposed fix, the child process logs are silently missed (like they never appear in the file or console) because the Since I will update the PR accordingly. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #89 +/- ##
==========================================
+ Coverage 76.81% 77.72% +0.91%
==========================================
Files 3 3
Lines 207 211 +4
==========================================
+ Hits 159 164 +5
+ Misses 48 47 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
|
Hey @JoeZiminski, pushed an update adding a user warning and fixing the validation order. |
|
Thanks @AlgoFoe! I think that looks good to me, nice test! My only thought is it might be better to error out and let the user change |
|
I'm not sure about throwing an error. I think we (and others) use fancylog as a dependency, and have |
JoeZiminski
left a comment
There was a problem hiding this comment.
Sure that makes sense, thanks @AlgoFoe!
|
Hi @JoeZiminski! Quick ping in case this slipped through, happy to make any further changes if needed. Thanks! |
|
Sorry @AlgoFoe LGTM! thanks again for the contribution |
Description
What is this PR
Why is this PR needed?
multiprocessing_aware=Truecan intermittently trigger shutdown errors whenmultiprocessing_loggingis installed bcoz background logging threads may access closed pipe handles even in single-process exec.What does this PR do?
multiprocessing_logginghandler in the main process and only enables it when running inside child processes.References
How has this PR been tested?
start_logging()withmultiprocessing_aware=Trueboth with and without spawning child processes.Is this a breaking change?
Does this PR require an update to the documentation?
Checklist: