I found a bug in Twiggy where if you're using a streaming writer and the client stops the request, the PSGI application dies in such a way that Twiggy itself shuts down. A test file and fix are included. The fix isn't the cleanest, but maybe it's a starting point you could improve upon!
Add test checking for a stream being broken
Twiggy (as of version 0.1024) shuts down after servicing
a request that writes streaming contents to a PSGI writer, and
the connection is broken.
Fix bug where Twiggy stops servicing requests
@miyagawa Have you had a chance to look at this?
@miyagawa If you have time, would you mind taking a look at this change?
sorry that it's taken such a long time. I don't really understand the fix, but sounds trivial enough to merge.
No problem, I had forgotten about it myself. Thanks!