[issue36668] semaphore_tracker is not reused by child processes

Thomas Moreau report at bugs.python.org
Fri Apr 19 09:44:01 EDT 2019


New submission from Thomas Moreau <thomas.moreau.2010 at gmail.com>:

The current implementation of the semaphore_tracker creates a new process for each children.

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). 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.

I propose to add a PROBE command in the semaphore tracker. When the pipe is closed, the send command will fail, meaning that the semaphore tracker is down.

----------
components: Library (Lib)
messages: 340543
nosy: tomMoral
priority: normal
severity: normal
status: open
title: semaphore_tracker is not reused by child processes
type: behavior
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36668>
_______________________________________


More information about the Python-bugs-list mailing list