[PATCH STABLE] worker: wait worker pid explicitly

Yuya Nishihara yuya at tcha.org
Sun Jul 24 02:32:10 EDT 2016

On Sat, 23 Jul 2016 19:34:36 +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.

or wait until all children collected or ECHILD. I prefer SIGCHLD handler over
threading, but that change wouldn't be trivial enough for stable.

> > Somewhat related, maybe we can handle this issue by worker-to-master pipe?
> > 
> > https://bz.mercurial-scm.org/show_bug.cgi?id=4929#c9 
> That sounds like a complex solution with a downside: the workers can be
> blocked if the master process does not read fast enough.

I think writing status/debug messages would be cheaper than the I/O jobs
running in workers. Currently the master process does nothing other than
yielding progress messages, so the read loop should run fast.


> Maybe we can just disable stdio buffer or make it flush at '\n'. It does not
> work for long line exceeding page size tho.

Also it doesn't work under vanilla commandserver which replaces ui.fout by
a pseudo file object.

More information about the Mercurial-devel mailing list