[PATCH 09 of 11] worker: allow a function to be run in multiple worker processes

Idan Kamara idankk86 at gmail.com
Sat Feb 9 11:33:42 CST 2013

On Sat, Feb 9, 2013 at 7:23 PM, Bryan O'Sullivan <bos at serpentine.com> wrote:
> On Sat, Feb 9, 2013 at 7:35 AM, Idan Kamara <idankk86 at gmail.com> wrote:
>> This exit is also going to be a problem for things that
>> call into the internal API.
> The master process will only exit if one of the workers exits abnormally.
> That should only occur if the worker crashes, in which case we would have
> crashed before anyway.

An exception would be raised and caught at dispatch, converted to an error
exit code and returned by dispatch.dispatch().

$ grep -r 'sys\.exit' mercurial/
mercurial/sshserver.py:99:        sys.exit(0)
mercurial/keepalive.py:741:        sys.exit()
mercurial/dispatch.py:28:    sys.exit((dispatch(request(sys.argv[1:]))
or 0) & 255)
mercurial/dispatch.py:202:        # Commands shouldn't sys.exit
directly, but give a return code.
mercurial/lsprof.py:105:        sys.exit(2)

The one at dispatch.py:28 isn't invoked by callers to the internal API.

More information about the Mercurial-devel mailing list