[PATCH 1 of 2 STABLE] worker: be silent if killed by the main process

Yuya Nishihara yuya at tcha.org
Sun Apr 23 09:57:36 EDT 2017


On Sun, 23 Apr 2017 05:08:48 -0700, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2017-04-23 19:56:13 +0900:
> > These look good to me, thanks. I think the first patch is simple enough to
> > include in stable if that helps solving the CI issue.
> > 
> > A few nits:
> > 
> >  - pid could be initialized to a null value instead of comparing to parentpid
> > 
> >    pid = -1
> >    try:
> >        pid = os.fork()
> >        ...
> >    finally:
> >        if pid == 0:
> 
> This won't pass the test. If fork() is completed, but "pid = os.fork()"
> assignment is not, pid still have the old value and will have trouble. I
> think it's safer to not assume whether Python implementation will make it
> atomic or not.

Maybe you're right. "call" and "store" are separated at interpreter level.

> >            os._exit()
> > 
> >  - BaseException can be used to catch any exception object
> 
> According to http://stackoverflow.com/a/7161517 , it will miss Python2
> old-style classes.

Doh.


More information about the Mercurial-devel mailing list