I think Twiggy fails to decrement exit_guard counter when, it fails to write response header (i.e EPIPE).
I have not written a test yet but this pull request should fix the problem. Please tell me if I am wrong in any ways.
decremented exit guard when failed to write header
Can you write a test, or at least how to reproduce the problem? Thanks!
Thanks for the response! I would write test and come back.
Hi @miyagawa san I have added a test.
Let me explain problems I am facing in detail. I have implemented Chat Online Server with Twiggy::Prefork and Server::Starter.
In our production environment, we see IO Error when writing header on rare occasion.
What happens then, is that Twiggy's exit_guard fails to decrement as I have written previously. And When we try to restart a process by HUP signal or process reaches max-request-per-client, the process stops to accept new connection and wait until all request are served, but this condition is never met due to exit_guard decrement failure and process hangs forever.
Added test for connection already closed on server response
Thanks as lot!