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

Switch from "fork" to "spawn" for multiprocessing in tests #4469

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

pradh
Copy link
Contributor

@pradh pradh commented Jul 12, 2024

Some kind of mysterious cloud build platform change broke "fork" start method for python multiprocessing. The "spawn" start method is apparently a safer alternative, since it doesn't inherit parent state into child (sharing state can cause deadlocks or mess up behavior, perhaps like we see now) -- doc.

However, "spawn" is finicky about pickling of methods and objects that get passed to the run() method.

So, this change does three things to switch over to "spawn" mode:

  1. Fix the multiprocessing.Process call we make to start NL server in a way that makes spawn happy
  2. The Web server gets started by an external library (flask_testing) in a way that makes spawn unhappy. So, stop using that (generally unmaintained) library, and instead start web server in our code.
  3. Given our support for spawn, we no longer set fork, so avoid the mac-os specific setting.

@pradh pradh requested a review from chejennifer July 12, 2024 07:21
@pradh pradh marked this pull request as draft July 12, 2024 07:22
@pradh
Copy link
Contributor Author

pradh commented Jul 12, 2024

This still makes Web Driver unhappy!

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

Successfully merging this pull request may close these issues.

1 participant