Skip to content

Conversation

@pitrou
Copy link
Member

@pitrou pitrou commented Aug 30, 2017

pitrou added 3 commits August 30, 2017 18:21
Add a warning if the semaphore process died, as semaphores may then be leaked.
@pitrou pitrou merged commit cbe1756 into python:master Nov 3, 2017
@pitrou pitrou deleted the semaphore_tracker_death branch November 3, 2017 13:31
pitrou added a commit to pitrou/cpython that referenced this pull request Nov 3, 2017
…ed again if crashed (pythonGH-3247)

* bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed

* Avoid mucking with process state in test.
Add a warning if the semaphore process died, as semaphores may then be leaked.

* Add NEWS entry
(cherry picked from commit cbe1756)
pitrou added a commit that referenced this pull request Nov 3, 2017
…ed again if crashed (GH-3247) (#4254)

* bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed

* Avoid mucking with process state in test.
Add a warning if the semaphore process died, as semaphores may then be leaked.

* Add NEWS entry
(cherry picked from commit cbe1756)
embray pushed a commit to embray/cpython that referenced this pull request Nov 9, 2017
…in if crashed (python#3247)

* bpo-31310: multiprocessing's semaphore tracker should be launched again if crashed

* Avoid mucking with process state in test.
Add a warning if the semaphore process died, as semaphores may then be leaked.

* Add NEWS entry
@tomMoral
Copy link
Contributor

With this PR, the semaphore_tracker is not shared with the children anymore and each process launches its own tracker.

The easy fix would be to pass the _pid to the children but the current mechanism to check if the semaphore_tracker is alive relies on waitpid which cannot be used in child processes (the semaphore_tracker is only a sibling of these processes).
I did some experiements with an extra cmd in the semaphore_tracker in #5172 . The main issue is to have a reliable check that either:

  • The pipe is open. This is what is done here by sending a message. I don't know if there is a more efficient way to check it.
  • Check that a given pid is alive. As we cannot rely on waitpid, I don't see an efficient mechanism.

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.

4 participants