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

Clarify the failure when a channel fails to create #98

Closed
mmmries opened this Issue Sep 20, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@mmmries
Contributor

mmmries commented Sep 20, 2016

I recently started seeing this error message in some of my logs:

NoMethodError: undefined method `add_shutdown_listener' for nil:NilClass
                    on_shutdown at /srv/bunyan/shared/bundle/jruby/2.3.0/gems/march_hare-2.18.0-java/lib/march_hare/channel.rb:183
                     initialize at /srv/bunyan/shared/bundle/jruby/2.3.0/gems/march_hare-2.18.0-java/lib/march_hare/channel.rb:135
                 create_channel at /srv/bunyan/shared/bundle/jruby/2.3.0/gems/march_hare-2.18.0-java/lib/march_hare/session.rb:169
           block in setup_queue at /srv/bunyan/shared/bundle/jruby/2.3.0/gems/action_subscriber-3.0.0.pre2-java/lib/action_subscriber/route_set.rb:34
       block in with_connection at /srv/bunyan/shared/bundle/jruby/2.3.0/gems/action_subscriber-3.0.0.pre2-java/lib/action_subscriber/rabbit_connection.rb:32

I spelunked through the code a bit and it looks like this a case where calling create_channel on the java connection returns nil, and then we pass that nil value into the constructor for the ruby Channel object.

Can we detect why the channel create failed in these cases? Can we raise an error about that failure rather than failing with an undefined method error?

@mmmries

This comment has been minimized.

Show comment
Hide comment
@mmmries

mmmries Sep 20, 2016

Contributor

I traced down the actual cause of my create_channel failing and it turned out that I had setup my broker to limit to the total number of channels for a given connection and one of my subscribers was trying to open more channels than the max.

Not sure if this information is available in the java driver or not.

Contributor

mmmries commented Sep 20, 2016

I traced down the actual cause of my create_channel failing and it turned out that I had setup my broker to limit to the total number of channels for a given connection and one of my subscribers was trying to open more channels than the max.

Not sure if this information is available in the java driver or not.

@michaelklishin

This comment has been minimized.

Show comment
Hide comment
@michaelklishin

michaelklishin Sep 20, 2016

Member

The best we can do is to throw an exception if Java client's createChannel returns null.

Member

michaelklishin commented Sep 20, 2016

The best we can do is to throw an exception if Java client's createChannel returns null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment