-
Couldn't load subscription status.
- Fork 5.6k
Prepare salt.utils.process for python 3.14 #68327
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
base: master
Are you sure you want to change the base?
Conversation
|
I think it makes more sense to modify |
Python 3.14 changed multiprocessing method from 'fork' to 'forkserver' on Linux too: python/cpython#84559 This leads to issue similar to when Python 3.8 changed it on Mac OS: saltstack#57742 Change the condition to check for != 'fork' instead of == 'spawn'.
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 found this as well. I fixed it by hacking multiprocessing.set_start_method('spawn') into salt.scripts.salt_master() because Python-3.14 seems to default to 'forkserver' and it seemed like the best way to conform to salt's expectations.
def salt_master():
"""
Start the salt master.
"""
import salt.cli.daemons
import multiprocessing
multiprocessing.set_start_method('spawn')
# Fix for setuptools generated scripts, so that it will
# work with multiprocessing fork emulation.
# (see multiprocessing.forking.get_preparation_data())
if __name__ != "__main__":
sys.modules["__main__"] = sys.modules[__name__]
master = salt.cli.daemons.Master()
master.start()
|
Does it make sense to switch all platforms to 'spawn'? Or do some not support it? |
What does this PR do?
Python 3.14 changed multiprocessing method from 'fork' to 'forkserver' on Linux too:
python/cpython#84559
This leads to issue similar to when Python 3.8 changed it on Mac OS: #57742
Change the condition to check for != 'fork' instead of == 'spawn'.
Question: should
salt.util.platform.spawning_platform()be changed instead?forkserverisn't exactly the same asspawn, but it's more similar to it than tofork.What issues does this PR fix or reference?
Related to #68148
Previous Behavior
Fails similar to #57742 on Linux with Python 3.14 (Fedora 43 beta)
New Behavior
Doesn't crash anymore
Merge requirements satisfied?
[NOTICE] Bug fixes or features added to Salt require tests.
Commits signed with GPG?
Yes