node-modules/graceful

How to return response when handling an uncaughtException event

Closed this issue · 3 comments

I want to call res.end() to return the response to the browser client when handling an uncaughtException event

There is no way to send response to the res which cause the uncaughtException.

And graceful will tell the next coming req and res don't keepalive and close connection after response sent. https://github.com/node-modules/graceful/blob/master/lib/graceful.js#L57 .

So I shoud set a shorter killTimeout when the server graceful exit.
How could get the right killTimeout

killTimeout default is 30s. It's enough for most http request.