You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On a system I've observed that a web server application written using warp sometimes terminates with exit code 0 for 'no reason'. After some debugging, I noticed that it ran out of file descriptors. The problem lies here:
-- Allow async exceptions before receiving the next connection maker.
allowInterrupt
-- acceptNewConnection will try to receive the next incoming
-- request. It returns a /connection maker/, not a connection,
-- since in some circumstances creating a working connection
-- from a raw socket may be an expensive operation, and this
-- expensive work should not be performed in the main event
-- loop. An example of something expensive would be TLS
-- negotiation.
mx <- acceptNewConnection
case mx of
Nothing->return()
Just (mkConn, addr) ->do
fork set mkConn addr app counter ii0
acceptLoop
acceptNewConnection =do
ex <- try getConnMaker
case ex of
Right x ->return$Just x
Left e ->do
let eConnAborted = getErrno eCONNABORTED
getErrno (Errno cInt) = cInt
if ioe_errno e ==Just eConnAborted
then acceptNewConnection
elsedo
settingsOnException set Nothing$ toException e
returnNothing
. With the default configuration, the exception is NOT logged and the runLoop simply terminates. I think it should always log the expection in default configuration if the server terminates. (Maybe even rethrow?)
The text was updated successfully, but these errors were encountered:
Yes, but I think the default defaultOnException with defaultShouldDisplayException misses the out of file descriptors exceptions and thus does not print it
On a system I've observed that a web server application written using
warp
sometimes terminates withexit code 0
for 'no reason'. After some debugging, I noticed that it ran out of file descriptors. The problem lies here:wai/warp/Network/Wai/Handler/Warp/Run.hs
Lines 224 to 253 in c6a542c
The text was updated successfully, but these errors were encountered: