-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
3.13.x: fix direct-reply-to crash and lost reply in 3.12 / 3.13 mixed version clusters #11401
Conversation
in 3.12 / 3.13 mixed version clusters Fixes #11380
Fix dialyzer error: ``` rabbit_channel.erl:309:1: The attempt to match a term of type mc:state() against the pattern {'basic_message', _, _, _, _, _} breaks the opacity of the term ```
Tested this PR with the following setup:
Here is the client code, using Bunny: #!/usr/bin/env ruby
require "bundler"
require "bunny"
c = Bunny.new(port: 5673); c.start
ch = c.create_channel
ch.basic_consume("amq.rabbitmq.reply-to", "", true) do |delivery_info, metadata, payload|
puts "Response: #{payload}"
end
loop do
ch.basic_publish(Time.now.to_i.to_s, "", "qq.1", reply_to: "amq.rabbitmq.reply-to")
sleep 1
end Here is the server code: #!/usr/bin/env ruby
require "bundler"
require "bunny"
c = Bunny.new(port: 5672); c.start
ch = c.create_channel
ch.quorum_queue("qq.1").subscribe(manual_ack: false) do |delivery_info, metadata, payload|
print "."
ch.basic_publish("#{payload}.response.#{rand}", "", metadata.reply_to)
end
loop do
sleep 1
end All common feature flags between the nodes were enabled after cluster formation. The clients communicate just fine using Direct Reply to. |
Apparently in #11380 the request-reply client is connected to the 3.13.x node. After swapping client and server connection ports I still observe no exceptions: #!/usr/bin/env ruby
require "bundler"
require "bunny"
c = Bunny.new(port: 5672); c.start
ch = c.create_channel
ch.basic_consume("amq.rabbitmq.reply-to", "", true) do |delivery_info, metadata, payload|
puts "Response: #{payload}"
end
loop do
ch.basic_publish(Time.now.to_i.to_s, "", "qq.1", reply_to: "amq.rabbitmq.reply-to")
sleep 1
end And the server code: #!/usr/bin/env ruby
require "bundler"
require "bunny"
c = Bunny.new(port: 5673); c.start
ch = c.create_channel
ch.quorum_queue("qq.1").subscribe(manual_ack: false) do |delivery_info, metadata, payload|
print "."
ch.basic_publish("#{payload}.response.#{rand}", "", metadata.reply_to)
end
loop do
sleep 1
end |
For the record, this PR contains a test which reproduces the issue:
makes the test fail with the following crash:
The other way around makes the test fail as well due to lost relpy (but without a crash in the logs):
|
Fixes #11380
This PR should only go into
v3.13.x
.#11397 should only go into
main
.