Skip to content
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

h5py_utils fork deprecation warning #4101

Open
t20100 opened this issue Apr 4, 2024 · 0 comments
Open

h5py_utils fork deprecation warning #4101

t20100 opened this issue Apr 4, 2024 · 0 comments

Comments

@t20100
Copy link
Member

t20100 commented Apr 4, 2024

With Python3.12, this deprecation warning is raised during the tests:

io/test/test_h5py_utils.py: 10 warnings
  multiprocessing/popen_fork.py:66: DeprecationWarning: This process (pid=770) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

From os.fork documentation:

Changed in version 3.12: If Python is able to detect that your process has multiple threads, os.fork() now raises a DeprecationWarning.

We chose to surface this as a warning, when detectable, to better inform developers of a design problem that the POSIX platform specifically notes as not supported. Even in code that appears to work, it has never been safe to mix threading with os.fork() on POSIX platforms. The CPython runtime itself has always made API calls that are not safe for use in the child process when threads existed in the parent (such as malloc and free).

Users of macOS or users of libc or malloc implementations other than those typically found in glibc to date are among those already more likely to experience deadlocks running such code.

See this discussion on fork being incompatible with threads for technical details of why we’re surfacing this longstanding platform compatibility problem to developers.

attn @woutdenolf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant