[PATCH STABLE] worker: wait worker pid explicitly

Yuya Nishihara yuya at tcha.org
Thu Jul 28 09:01:14 EDT 2016


On Wed, 27 Jul 2016 14:43:17 -0500, Matt Mackall wrote:
> On Wed, 2016-07-27 at 11:09 +0100, Jun Wu wrote:
> > Excerpts from Matt Mackall's message of 2016-07-25 16:18:02 -0500:
> > > On Sat, 2016-07-23 at 19:34 +0100, Jun Wu wrote:
> > > > Excerpts from Yuya Nishihara's message of 2016-07-23 23:39:54 +0900:
> > > > > New implementation can't detect failures ASAP, which is what
> > > > > 9955fc5ee24b
> > > > > tried to solve.
> > > > > 
> > > > > https://selenic.com/repo/hg/rev/9955fc5ee24b
> > > > It seems SIGCHLD handler + waitpid WNOHANG is the solution then.
> > > Can you take a stab at this variant?
> > Will send the patch after freeze.
> 
> I would say this constitutes a freeze-worthy fix, if you can fit it in.

Perhaps the minimal patch would be to wait until all pids are reaped, something
like this:

    while knownpids:
        try:
            pid, st = os.wait()
        except ...
            # catch ECHILD
        if pid not in knownpids:
            continue
        knownpids.remove(pid)


More information about the Mercurial-devel mailing list