This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients giampaolo.rodola, njs, vstinner
Date 2019-11-14.11:08:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573729729.12.0.394332656354.issue38630@roundup.psfhosted.org>
In-reply-to
Content
> To further elaborate on the creation time solution, the idea in pseudo-code is the following: (...)
> Technically there is still a race condition between _execute_child() and get_create_time(), but: (...)

Even if the approach seems to be different, PR 16984 seems to have the same advantages and drawbacks.

PR 16984 rely on the fact that the Linux kernel doesn't use a pid until its parent calls os.waitpid(). Even if the child process completed, the pid remains assigned (and the process status is "zombie").

PR 16984 has the advantage that it reuses existing code which has been battle tested: we are sure that the code is portable and works well.

Whereas get_create_time() will be likely platform specific and will add a little maintenance burden.

I know that PR 16984 is a partial solution (there is still a race condition if waitpid() is called directly, without using the Popen API), but I don't see a strong reason to prefer get_create_time().
History
Date User Action Args
2019-11-14 11:08:49vstinnersetrecipients: + vstinner, giampaolo.rodola, njs
2019-11-14 11:08:49vstinnersetmessageid: <1573729729.12.0.394332656354.issue38630@roundup.psfhosted.org>
2019-11-14 11:08:49vstinnerlinkissue38630 messages
2019-11-14 11:08:48vstinnercreate