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

create_channel on a connection intentionally closed by the user shown immediately throw an argument/illegal state exception #465

Closed
madAle opened this issue Mar 2, 2017 · 2 comments
Labels

Comments

@madAle
Copy link
Contributor

@madAle madAle commented Mar 2, 2017

Hi,

I just found this (weird?) behaviour: when creating a channel after a connection.close Bunny tries to recover from a network failure thus failing and getting into a Timeout exception. Is the client supposed to behave in this way? See attached code:

require 'bunny'

client = Bunny.new
client.start

channel = client.create_channel
channel.default_exchange.publish "hello"

client.stop

client.create_channel

# Bunny tries to recover from a network failure

#<Bunny::Session:0x7fd0b8152300 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>: Recovering from a network failure...
#<Bunny::Session:0x7fd0b8152300 guest@127.0.0.1:5672, vhost=/, addresses=[127.0.0.1:5672]>: Retrying connection on next host in line: 127.0.0.1:5672

# Timeout::Error (Timeout::Error)

Thanks.

@michaelklishin
Copy link
Member

@michaelklishin michaelklishin commented Mar 2, 2017

Transport write failures trigger a recovery. When a connection is intentionally closed it should throw an exception, much like other clients do.

@madAle
Copy link
Contributor Author

@madAle madAle commented Mar 2, 2017

👍

@michaelklishin michaelklishin changed the title create_channel after connection.close create_channel on a connection intentionally closed by the user shown immediately throw an argument/illegal state exception Mar 2, 2017
@madAle madAle mentioned this issue Mar 2, 2017
michaelklishin added a commit that referenced this issue Mar 2, 2017
Fix #465
michaelklishin added a commit that referenced this issue Mar 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.