[PATCH V2] chgserver: create new process group after fork (issue5051)

Yuya Nishihara yuya at tcha.org
Wed Jan 20 08:32:50 CST 2016


On Wed, 20 Jan 2016 10:44:50 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1453227613 0
> #      Tue Jan 19 18:20:13 2016 +0000
> # Node ID bc3a251a56a50ee825ffffcf941973ecae3d78bc
> # Parent  d2c5ad3deccb5a504e2553652b66a4110db68afb
> chgserver: create new process group after fork (issue5051)

LGTM, thanks for investigation.
I'll queue this when default branch is reopened.

> This is to make SIGTSTP work. Before the patch, the server process group is
> considered "orphaned" and will ignore SIGTSTP, SIGTTIN, SIGTTOU, according to
> POSIX. See the comment above `will_become_orphaned_pgrp` in `kernel/exit.c`
> from Linux 4.3 for details.

(I don't have a good knowledge of session/job control, I just read several
manpages about orphaned process group.)

Assuming the master server process (= session leader) is a job-control process,
forked workers can be considered job processes. So it seems legit to give a
separate process group to each worker.


More information about the Mercurial-devel mailing list