yesodweb/wai — pull request #93 by kazu-yamamoto (2012-07-20 05:06:01+00:00)
Title: safer accept against "resource exhausted".

When warp opens many sockets, accept() throws "resource exhausted" exception.
If this occurs, warp cannot proceed any new connections.

This patch makes accept() safer. If the exception is thrown, the main thread waits a second and
retry accept(). I confirmed this patch lets warp survive in severe situation.

Minor concern: GHC.IO.Exception is imported. I don't know this is acceptable for wai coding style.

Major concern: accept() is not safe against other exceptions. Warp should at least report any errors through onE but I have no good idea to do so.