[PATCH 6 of 8 V5] worker: make sure killworkers runs at most once

Yuya Nishihara yuya at tcha.org
Wed Nov 16 10:27:05 EST 2016


On Wed, 16 Nov 2016 15:11:27 +0000, Jun Wu wrote:
> Excerpts from Yuya Nishihara's message of 2016-11-17 00:00:01 +0900:
> > On Wed, 16 Nov 2016 13:57:58 +0000, Jun Wu wrote:
> > > Excerpts from Yuya Nishihara's message of 2016-11-16 21:25:45 +0900:
> > > > I meant set.discard(). My idea is:
> > > > 
> > > >  a. discard pid by anyone who notices it no longer exists
> > > >  b. then, kill the rest
> > > 
> > > This looks good. Although it's still possible to kill processes multiple
> > > times (because atomic "wait-and-drop-pid" is impossible).
> > 
> > Hmm, signal handlers are stacked at arbitrary code location, there's no
> > time-based preemption like threading, I think. So even if the wait-discard(p)
> > sequence is interrupted by another waitforworkers(), the process "p" would
> > be discarded before killworkers() thanks to ECHILD. And we do unregister the
> > SIGCHLD handler before killworkers().
> > 
> > I'll queue the series without the patch 6.
> 
> That will break Python < 2.7.4 if iterfile workaround is not ready.
> Hopefully I can figure out the final solution today.

Oops, I've just pushed this. Hope you'll fix the problem soon.


More information about the Mercurial-devel mailing list