falcon
falcon copied to clipboard
Consider rescueing Async::TimeoutError in Falcon::Server
I've been having a spurious Async::TimeoutError
in my logs whenever a TCP connection to the client is closed. After some digging I've monkey-patched Falcon::Server
like this:
module Falcon
class Server < Async::HTTP::Server
def accept(peer, address, task: Task.current)
begin
super
rescue Async::TimeoutError
Async.logger.debug(self) {"Client #{address.inspect} disconnected: timeout"}
end
end
end
end
Unless I am mixing something up. Async::TimeoutError
should be rescued here.
Hmmm, thanks for this report. I'll check. So, it's actually the connect operation that's failing?
Basically, I load the server on my localhost, make a few requests, wait a couple of minutes, and then I see Async::TimeoutError
and the backtrace in red, which doesn't look very nice in logs.
Okay, I will think about the best way to deal with this.