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

Raise when calling wait_for_confirms on a closed channel #428

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/bunny/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1783,6 +1783,8 @@ def wait_on_basic_get_continuations

# @private
def wait_on_confirms_continuations
raise_if_no_longer_open!

if @connection.threaded
t = Thread.current
@threads_waiting_on_confirms_continuations << t
Expand Down
12 changes: 12 additions & 0 deletions spec/higher_level_api/integration/publisher_confirms_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,18 @@
}.not_to raise_error

end

it "raises an error when called on a closed channel" do
ch = connection.create_channel

ch.confirm_select

ch.close

expect {
ch.wait_for_confirms
}.to raise_error(Bunny::ChannelAlreadyClosed)
end
end

context "when some of the messages get nacked" do
Expand Down