Giter Club home page Giter Club logo

Comments (7)

michaelklishin avatar michaelklishin commented on August 28, 2024

Carl,

Your understanding is correct: this suggests a TCP connection failure which Bunny 0.9 does not detect yet. This is the next big thing I am going to work on.

from bunny.

michaelklishin avatar michaelklishin commented on August 28, 2024

Using heartbeats should help. Can you be using load balancers/proxies by any chance? Those may be closing connections they consider idle. Bunny 0.9 should set SO_KEEPALIVE on the socket it uses.

from bunny.

carlhoerberg avatar carlhoerberg commented on August 28, 2024

do you want me to test with a LB or are you asking if i used one when i got this error? yes and no..

from bunny.

celldee avatar celldee commented on August 28, 2024

Some observations on a long-running Bunny/RabbitMQ connection in irb that you may be interested in -

  1. Bunny 0.9 does not seem to set keepalive on a socket by default, however, you can explicitly set it with Bunny.new(:keepalive => true)
  2. RabbitMQ 3.0.0 has a default heartbeat interval of 600 secs. After using Wireshark, the server did indeed send heartbeats to the client and kills the connection some time after 2 heartbeats have been sent without reply. This results in the loop described above.
  3. Bunny::Session#negotiate_value method doesn't allow the heartbeat interval to be set to 0 if the server setting is > 0. Looking at the AMQP 0.9.1 spec (http://www.rabbitmq.com/amqp-0-9-1-reference.html), I think that Bunny should allow the heartbeat interval to be set to 0 regardless of the server setting.

from bunny.

carlhoerberg avatar carlhoerberg commented on August 28, 2024

Similar thing happens when a connection is forcefully closed:

NoMethodError
undefined method `read_fully' for nil:NilClass
/Users/carl/.rvm/gems/ruby-1.9.3-p194/gems/bunny-0.9.0.pre3/lib/bunny/transport.rb:109:in `read_next_frame'
/Users/carl/.rvm/gems/ruby-1.9.3-p194/gems/bunny-0.9.0.pre3/lib/bunny/main_loop.rb:26:in `block in run_loop'
/Users/carl/.rvm/gems/ruby-1.9.3-p194/gems/bunny-0.9.0.pre3/lib/bunny/main_loop.rb:22:in `loop'
/Users/carl/.rvm/gems/ruby-1.9.3-p194/gems/bunny-0.9.0.pre3/lib/bunny/main_loop.rb:22:in `run_loop'

from bunny.

michaelklishin avatar michaelklishin commented on August 28, 2024

I agree with that we probably should allow setting heartbeats to 0. I will look into that tomorrow. And we should make :keepalive => true the default, it makes much more sense that way.

from bunny.

michaelklishin avatar michaelklishin commented on August 28, 2024

Done, 0.9.0.pre6 includes this feature.

from bunny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.