adhearsion / virginia

A Reel interface to Adhearsion
MIT License
7 stars 10 forks source link

Exceptions are reported twice #6

Open bklang opened 10 years ago

bklang commented 10 years ago

Given code like this:

require 'reel'
class RequestHandler
  def initialize(host, port)
    logger.info "HTTP Request Handler initialized on #{host}:#{port}"
    @server = Reel::Server.supervise(host, port) do |connection|
      connection.each_request do |request|
        raise "blat"
      end
    end
  end
end

I get duplicate exceptions in the logs:

06:20:52 ahn.1  | [2014-02-20 06:20:52.338] ERROR Celluloid: Reel::Server crashed!
06:20:52 ahn.1  | RuntimeError: blat
06:20:52 ahn.1  |   /vagrant/ahn/lib/request_handler.rb:16:in `block (2 levels) in initialize'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/reel-0.4.0/lib/reel/connection.rb:74:in `each_request'
06:20:52 ahn.1  |   /vagrant/ahn/lib/request_handler.rb:15:in `block in initialize'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/reel-0.4.0/lib/reel/server.rb:32:in `call'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/reel-0.4.0/lib/reel/server.rb:32:in `handle_connection'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:122:in `dispatch'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
06:20:52 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'
06:20:52 ahn.1  | [2014-02-20 06:20:52.338] WARN  Celluloid: Terminating task: type=:call, meta={:method_name=>:run}, status=:iowait
06:20:54 ahn.1  | [2014-02-20 06:20:52.338] ERROR Adhearsion::Initializer: <RuntimeError> blat
06:20:54 ahn.1  |   /vagrant/ahn/lib/request_handler.rb:16:in `block (2 levels) in initialize'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/reel-0.4.0/lib/reel/connection.rb:74:in `each_request'
06:20:54 ahn.1  |   /vagrant/ahn/lib/request_handler.rb:15:in `block in initialize'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/reel-0.4.0/lib/reel/server.rb:32:in `call'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/reel-0.4.0/lib/reel/server.rb:32:in `handle_connection'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `public_send'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:25:in `dispatch'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/calls.rb:122:in `dispatch'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:322:in `block in handle_message'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/actor.rb:416:in `block in task'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:55:in `block in initialize'
06:20:54 ahn.1  |   /vagrant/ahn/vendor/ruby/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks/task_fiber.rb:13:in `block in create'

Good news is that, despite the scary looking text, the Reel server does continue to process requests.