[PATCH 5 of 5 STABLE V2] worker: add a SIGCHLD handler

Yuya Nishihara yuya at tcha.org
Fri Jul 29 10:20:06 EDT 2016


On Thu, 28 Jul 2016 21:50:08 +0100, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1469737655 -3600
> #      Thu Jul 28 21:27:35 2016 +0100
> # Node ID 862244b11d9db6df3d6b07756cfab06b5768d17f
> # Parent  3e52c87875599106cd17b264df93c903a3876dfb
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r 862244b11d9d
> worker: add a SIGCHLD handler
> 
> As planned, we add a SIGCHLD handler to notice and handle child failure
> immediately.
> 
> diff --git a/mercurial/worker.py b/mercurial/worker.py
> --- a/mercurial/worker.py
> +++ b/mercurial/worker.py
> @@ -110,10 +110,14 @@ def _posixworker(ui, func, staticargs, a
>              if st and not problem[0]:
>                  problem[0] = st
>                  killworkers()
> +    def sigchldhandler(signum, frame):
> +        waitforworkers(False)

and drop use of threading?

waitforworkers() updates problems[0] non-atomically.

Other than that, the series looks good. But I'm afraid of including them in
stable because of little test/real-world coverage.


More information about the Mercurial-devel mailing list