[PATCH STABLE] worker: wait worker pid explicitly

Sean Farley sean at farley.io
Fri Jul 22 18:20:22 EDT 2016


Jun Wu <quark at fb.com> writes:

> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1469216267 -3600
> #      Fri Jul 22 20:37:47 2016 +0100
> # Node ID 74d799c4781183b539aedd93530f0e5fa06839cc
> # Parent  d3df009ab1175a6792549b51ae66486dd98f398b
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 74d799c47811
> worker: wait worker pid explicitly
>
> Before this patch, waitforworkers uses os.wait() to collect child workers, and
> only wait len(pids) processes. This can have serious issues if other code
> spawns new processes and does not reap them: 1. worker.py may get wrong exit
> code and kill innocent workers. 2. worker.py may continue without waiting for
> all workers to complete.
>
> This patch fixes the issue by using waitpid to wait worker pid explicitly.

I think this is a good fix but Yuya knows more about this than I do.


More information about the Mercurial-devel mailing list