GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||
GeezerVison is showing github.com — gh-100228: Warn from os.fork() if other threads exist. by gpshead · Pull Request #100229 · python/cpython Conversation
|
✅ Deploy Preview for python-cpython-preview canceled.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
* Only warn in the parent process. * Add a test to test_os that a non-Python thread triggers the warning. * Avoid the system calls to count threads if we've already warned once. * The macOS API calls were written blind based on docs, will fix later if CI fails.
…o warn/os.fork/threads
I don't want the array of thread info but it may insist?
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Let the thread free and clear things as it ends after we unblock it.
It could hide more than we intend and wouldn't do what I wanted in child processes that inherit the parents warnings state anyways.
…gtzMV.rst Co-authored-by: T. Wouters <[email protected]>
Co-authored-by: T. Wouters <[email protected]>
Since python 3.12 python/cpython#100229, fork inside a multithreaded process will raise a warning. We actually have another solution to get rid of the fork that was implemented in more recent versions.
Since python 3.12 python/cpython#100229, fork inside a multithreaded process will raise a warning. We actually have another solution to get rid of the fork that was implemented in more recent versions. closes #163562 Signed-off-by: Christophe Monniez (moc) <[email protected]>
|
is the use of |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
we can't disable it because people depend on it whether that's wise or not, but it is always the wrong thing to do. we're not going to create a "YouWillSufferMysteriousProblemsWarning" for such purposes. DeprecationWarning is accurate because it is something people used to do a lot but underlying platforms have significantly moved on such that things that relied on what they could get away with 15-20 years ago are no longer feasible in many normal environments today. the deadlocks can come from the platform level and other low level libraries including the C stdlib and malloc and whatnot. it does not matter if you think you interact with the threads at all, just that they exist and are running is enough to lead to scenarios outside your control where problems happen randomly when forking. for functions defined in the test themselves, the normal advise is to refactor the code so it is something pickle can handle (generally: not being defined on the fly) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Where can I get your input on an issue I'm seeing where I dont actually see why this warning is being emitted? This has to do with the use of the pytest-xdist plugin which uses a tool called execnet. When using this plugin, if our own test uses fork, we get the warning. however, I've created a suite that runs through output can be seen as follows - as you can see I'm not able to find any additional threads that are known to the Python interpreter. So....execnet is spawning threads outside of the interpreter? is that what has to be happening? is that a bug for them? I've looked at execnet a few times and so far it's opaque to me what it's doing or how pytest-xdist uses it. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
i've opened an issue at pytest-dev/pytest-xdist#1186 |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.