[PATCH STABLE] worker: wait worker pid explicitly

Yuya Nishihara yuya at tcha.org
Mon Jul 25 08:49:35 EDT 2016

On Mon, 25 Jul 2016 10:27:17 +0100, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2016-07-24 15:32:10 +0900:
> > Also it doesn't work under vanilla commandserver which replaces ui.fout by
> > a pseudo file object.
> I think commandserver needs some lock mechanism to protect its I/O. flock
> is a good choice wherever supported. The problem is not only limited to
> workers but also any other places using threads / processes.

No idea how flock() will work for duplicated fds. Are we going to make a
temporary lock file?

As long as underlying fwrite() is thread-safe, the issue can be avoided
by writing header + data by single write() call. That can't be true for
fork(), but IIRC worker.py is the only place we have to care.

More information about the Mercurial-devel mailing list