Skip to content

Be more defensive when importing definitions where some virtual hosts do not have a default queue type (backport #10896) (backport #10897) #10898

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

Merged
merged 2 commits into from
Apr 2, 2024

Conversation

mergify[bot]
Copy link

@mergify mergify bot commented Apr 2, 2024

This is #10891 by @tomyouyou with a cosmetic change from me.


This is an automatic backport of pull request #10896 done by Mergify.
This is an automatic backport of pull request #10897 done by Mergify.

tomyouyou and others added 2 commits April 2, 2024 06:26
…tions

the version of erlang is erlang-25.3.2.6-1.el8.x86_64.
the version of rabbitmq-server is rabbitmq-server-3.12.10-1.

To reproduce the exception as follows:
1. rabbitmqctl export_definitions def.json
2. rabbitmqctl import_definitions def.json
3. The result of ''rabbit_definitions:list_vhosts()' is:
[root@c1 ssl]#  rabbitmqctl eval 'rabbit_definitions:list_vhosts().'
[#{<<"limits">> => [],
   <<"metadata">> =>
       #{default_queue_type => undefined,
         description => <<"Default virtual host">>,tags => []},
   <<"name">> => <<"/">>}

4. rabbitmqctl export_definitions def.json
5. rabbitmqctl import_definitions def.json
6. The result of ''rabbit_definitions:list_vhosts()' is:
[root@c1 ssl]#  rabbitmqctl eval 'rabbit_definitions:list_vhosts().'
[#{<<"limits">> => [],
   <<"metadata">> =>
       #{default_queue_type => <<"undefined">>,
         description => <<"Default virtual host">>,tags => []},
   <<"name">> => <<"/">>}
7. Declare a queue and an exception will appear, as shown below:
2024-03-29 17:38:09.696 [error] <0.1441.0> ** Generic server <0.1441.0> terminating, ** Last message in was {'$gen_cast', {method, {'queue.declare',0,<<"q12">>,false,false, false,false,false,[]}, none,noflow}}, ** When Server state == {ch, {conf,running,rabbit_framing_amqp_0_9_1,1, <0.1432.0>,<0.1439.0>,<0.1432.0>, <<"10.225.80.5:40388 -> 10.225.80.5:5673">>, undefined, {user,<<"guest">>, [administrator], [{rabbit_auth_backend_internal, #Fun<rabbit_auth_backend_internal.3.2577553>}]}, <<"/">>,<<>>,<0.1433.0>, [{<<"authentication_failure_close">>,bool,true}, {<<"basic.nack">>,bool,true}, {<<"connection.blocked">>,bool,true}, {<<"consumer_cancel_notify">>,bool,true}, {<<"publisher_confirms">>,bool,true}], none,0,134217728,1800000,#{},1000000000,false}, {lstate,<0.1440.0>,false}, none,1, {0,[],[]}, {state,#{},erlang}, #{},#{}, {state,fine,30000, #Ref<0.3663679405.4218945538.136240>}, true,1, {rabbit_confirms,undefined,#{}}, [],[],none,flow,[], {rabbit_queue_type,#{}}, #Ref<0.3663679405.4218945537.194739>,false, {erlang,#Ref<0.3663679405.4218945537.194740>}, "none",false}, ** Reason for termination == , ** {function_clause, [{rabbit_queue_type,discover, [<<"undefined">>], [{file,"rabbit_queue_type.erl"},{line,225}]}, {rabbit_amqqueue,augment_declare_args,5, [{file,"rabbit_amqqueue.erl"},{line,804}]}, {rabbit_channel,handle_method,6, [{file,"rabbit_channel.erl"},{line,2762}]}, {rabbit_channel,handle_method,3, [{file,"rabbit_channel.erl"},{line,1828}]}, {rabbit_channel,handle_cast,2, [{file,"rabbit_channel.erl"},{line,728}]}, {gen_server2,handle_msg,2,[{file,"gen_server2.erl"},{line,1056}]}, {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,240}]}]},

(cherry picked from commit 94701c6)
(cherry picked from commit 0161190)
(cherry picked from commit fb05a51)
(cherry picked from commit 7c9beef)
@michaelklishin michaelklishin added this to the 3.12.14 milestone Apr 2, 2024
@michaelklishin michaelklishin merged commit 3eb259b into v3.12.x Apr 2, 2024
13 checks passed
@michaelklishin michaelklishin deleted the mergify/bp/v3.12.x/pr-10897 branch April 2, 2024 19:59
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