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

Repeated error messages being output when broker goes down #76

Closed
markiz opened this issue Dec 13, 2012 · 2 comments
Closed

Repeated error messages being output when broker goes down #76

markiz opened this issue Dec 13, 2012 · 2 comments

Comments

@markiz
Copy link

markiz commented Dec 13, 2012

I've got a consumer that uses Queue#pop method. After broker is restarted or closed, insane amounts of these error messages are output:

NoMethodError
undefined method `read_fully' for nil:NilClass
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/transport.rb:109:in `read_next_frame'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/main_loop.rb:26:in `block in run_loop'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/main_loop.rb:22:in `loop'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/main_loop.rb:22:in `run_loop'
AMQ::Protocol::EmptyResponseError
Empty response received from the server.
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/gems/amq-protocol-1.0.1/lib/amq/protocol/frame.rb:45:in `decode_header'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/transport.rb:110:in `read_next_frame'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/main_loop.rb:26:in `block in run_loop'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/main_loop.rb:22:in `loop'
/Users/mark/.rvm/gems/ruby-1.9.3-p327@forum-corpus/bundler/gems/bunny-6fae2db09c0d/lib/bunny/main_loop.rb:22:in `run_loop'

I assume it happens from here: https://github.com/ruby-amqp/bunny/blob/master/lib/bunny/main_loop.rb#L54

On our servers it kept outputting until we were out of disk space :(
This problem is actually two-fold:

  1. There doesn't seem to be a way to detect broker going down
  2. Tight loop that catches all exceptions and outputs A LOT. I think it's much better to simply fail when unknown error happens.
@markiz
Copy link
Author

markiz commented Dec 13, 2012

It should also be fairly easy to reproduce:

  1. Launch irb console
  2. Start consuming:

    1.9.3p327 :001 > b = Bunny.new
    1.9.3p327 :002 > b.start
    1.9.3p327 :003 > q = b.queue('a')
    1.9.3p327 :004 > loop { _, _, m = q.pop; puts(m.inspect) if m; sleep(0.5) }
  3. Stop AMQP broker
  4. Your console should be full of error messages

@michaelklishin
Copy link
Member

Duplicate of #74

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants