Skip to content

Conversation

@pitrou
Copy link
Member

@pitrou pitrou commented Aug 30, 2017

@pitrou
Copy link
Member Author

pitrou commented Aug 30, 2017

TODO: investigate what happens with previously-launched processes.

Edit: done.

@pitrou
Copy link
Member Author

pitrou commented Sep 2, 2017

@applio, I'm planning to merge this soon.


proc.join()
self.assertTrue(evt.is_set())
self.assertIn(proc.exitcode, (0, 255))
Copy link
Contributor

@gst gst Sep 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

I don't see/get where you assert that a new process is started.. something like :

new_pid = _forkserver._forkserver_pid  # EDIT removed typo assert
assert new_pid is not None and pid != new_pid

or did I miss something ?

Regards.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed I don't. I'm not sure it's important, though, since what matters is that the Process API continues working properly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. self.Process(..) does that indeed.

@applio
Copy link
Member

applio commented Sep 11, 2017

Added comments on the issue tracker (at https://bugs.python.org/issue31308).

In short, I like the idea but I think we need to be more explicit about what we ask the forkserver to do.

@pitrou pitrou merged commit fc6b348 into python:master Nov 3, 2017
@pitrou pitrou deleted the detect_forkserver_death branch November 3, 2017 12:34
pitrou added a commit to pitrou/cpython that referenced this pull request Nov 3, 2017
…n when necessary (pythonGH-3246)

* bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary.

* Fix test on Windows

* Add NEWS entry

* Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker.

* Fix comment

* Make sure the test doesn't muck with process state

* Also test previously-started processes

* Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst

* Avoid masking SIGTERM in forkserver.  It's not necessary and causes a race condition in test_many_processes..
(cherry picked from commit fc6b348)
pitrou added a commit that referenced this pull request Nov 3, 2017
…n when necessary (GH-3246) (#4252)

* bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary.

* Fix test on Windows

* Add NEWS entry

* Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker.

* Fix comment

* Make sure the test doesn't muck with process state

* Also test previously-started processes

* Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst

* Avoid masking SIGTERM in forkserver.  It's not necessary and causes a race condition in test_many_processes..
(cherry picked from commit fc6b348)
embray pushed a commit to embray/cpython that referenced this pull request Nov 9, 2017
… necessary (python#3246)

* bpo-31308: If multiprocessing's forkserver dies, launch it again when necessary.

* Fix test on Windows

* Add NEWS entry

* Adopt a different approach: ignore SIGINT and SIGTERM, as in semaphore tracker.

* Fix comment

* Make sure the test doesn't muck with process state

* Also test previously-started processes

* Update 2017-08-30-17-59-36.bpo-31308.KbexyC.rst

* Avoid masking SIGTERM in forkserver.  It's not necessary and causes a race condition in test_many_processes.
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.

5 participants