Closed markwellis closed 8 years ago
as far as i've tested, this works ok. I'm going to run it on out production environment shortly, and will be alerted of any errors.
my testing went like this. i had a small psgi app that accepted a POST, and printed it back to the client, or a GET and printed 'hello world'. i ran this with 2 workers. i ran a rate limited curl upload on one worker, and a regular GET request on the other to make sure it was working as expected.
then i kill -SIGTERM the master pid, and try the GET request, it returned connection refused, and the POST contiuned upload, and then download, and i compared the uploaded vs downloaded.
without this patch, the GET request after the SIGTERM will hang, which was causing us "Server closed connection without sending any data back" errors.
I can't think of a way to unit test this properly unfortuantly
OK. I've tested our setup with and without this, and it definitely helps. So reopening
bump
thanks @kazeburo :+1:
so that new connections will not hang, and instead will return "connection refused".
Existing connections will continue until finished, then shutdown as well.