Re: [Python-Dev] socketserver ForkingMixin waiting for child processes

2017-08-18 Thread Victor Stinner
2017-08-12 0:34 GMT+02:00 Ryan Smith-Roberts : > Since ThreadingMixIn also leaks threads, > server_close() could grow a timeout flag (following the socket module > timeout convention) and maybe a terminate boolean. ThreadingMixIn could then > also be fixed. I'm not sure how useful

Re: [Python-Dev] socketserver ForkingMixin waiting for child processes

2017-08-16 Thread Victor Stinner
Hi, The first bug was that test_socketserver "leaked" child processes: it means that socketserver API creates zombie processes depending how long the child processes take to complete. If you want to backport my change waiting until child processes complete, you need to fix the bug differently,

Re: [Python-Dev] socketserver ForkingMixin waiting for child processes

2017-08-12 Thread Martin Panter
> On Fri, Aug 11, 2017 at 6:46 AM Victor Stinner > wrote: >> => http://bugs.python.org/issue31151 >> >> I changed the code to call waitpid() in blocking mode on each child >> process on server_close(), to ensure that all children completed when >> on server close: >> >>

Re: [Python-Dev] socketserver ForkingMixin waiting for child processes

2017-08-11 Thread Ryan Smith-Roberts
I agree that blocking shutdown by default isn't a good idea. A child will eventually get indefinitely stuck on a nonresponsive connection and hang the whole server. This behavior change is surprising and should be reverted in master, and definitely not backported. As for block-timeout or

Re: [Python-Dev] socketserver ForkingMixin waiting for child processes

2017-08-11 Thread Matt Billenstein
Common pattern I've used is to wait a bit, then send a kill signal. M -- Matt Billenstein m...@vazor.com Sent from my iPhone 6 (this put here so you know I have one) > On Aug 11, 2017, at 5:44 AM, Victor Stinner wrote: > > Hi, > > I'm working on reducing the

[Python-Dev] socketserver ForkingMixin waiting for child processes

2017-08-11 Thread Victor Stinner
Hi, I'm working on reducing the failure rate of Python CIs (Travis CI, AppVeyor, buildbots). For that, I'm trying to reduce test side effects using "environment altered" warnings. This week, I worked on support.reap_children() which detects leaked child processes (usually created with os.fork()).