Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider rescueing Async::TimeoutError in Falcon::Server #46

Open
ainar-g opened this issue Jan 22, 2019 · 3 comments
Open

Consider rescueing Async::TimeoutError in Falcon::Server #46

ainar-g opened this issue Jan 22, 2019 · 3 comments
Assignees

Comments

@ainar-g
Copy link

ainar-g commented Jan 22, 2019

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.

@ioquatix
Copy link
Member

Hmmm, thanks for this report. I'll check. So, it's actually the connect operation that's failing?

@ainar-g
Copy link
Author

ainar-g commented Jan 22, 2019

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.

@ioquatix
Copy link
Member

Okay, I will think about the best way to deal with this.

@ioquatix ioquatix self-assigned this Jan 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants