Skip to content

Respond with basic.cancel-ok if the server supports it - #754

Merged
michaelklishin merged 3 commits into
mainfrom
rabbitmq-server-17734
Oct 7, 2026
Merged

michaelklishin merged 3 commits into
mainfrom
rabbitmq-server-17734

Conversation

@michaelklishin

@michaelklishin michaelklishin commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

@michaelklishin michaelklishin added this to the 3.5.0 milestone Oct 6, 2026
@eglitobias

Copy link
Copy Markdown
Contributor

Good morning @michaelklishin, Thank you! Looks good.

One suggestion: Maybe add a small integration spec that checks the channel is still usable after a server-sent basic.cancel. With the 4.2/4.3 CI matrix it would cover both the capability guard and the hand-packed frame. Something like:

context "with a server-sent basic.cancel" do
  let(:queue_name) { "basic.consume#{rand}" }

  it "keeps the channel usable" do
    cancellations = Thread::Queue.new

    ch = connection.create_channel
    q  = ch.durable_queue(queue_name, Bunny::Queue::Types::QUORUM)
    q.subscribe(on_cancellation: Proc.new { |*| cancellations << true })

    connection.with_channel { |ch2| ch2.queue_delete(queue_name) }

    expect(cancellations.pop(timeout: 5)).to eq true
    expect { ch.basic_qos(10) }.not_to raise_error
    expect(ch).to be_open
  end
end

I ran it locally against 4.2.9, 4.3.6 and today's v4.3.x nightly (4.3.6 doesn't advertise accept_consumer_cancel_ok yet, so only the nightly exercises the send path). It passes on all three, and fails on 4.2 without the capability check and on the nightly with a broken frame.

@michaelklishin
michaelklishin merged commit 39016b7 into main Oct 7, 2026
17 checks passed
@michaelklishin
michaelklishin deleted the rabbitmq-server-17734 branch October 7, 2026 23:21
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

Successfully merging this pull request may close these issues.

2 participants