-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix concurrent AMQP queue declarations #13727
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
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred: ``` │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>, │ {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}}, │ {{utf8,<<"message_count">>},{ulong,0}}, │ {{utf8,<<"consumer_count">>},{uint,0}}, │ {{utf8,<<"name">>},{utf8,<<"cq-145">>}}, │ {{utf8,<<"vhost">>},{utf8,<<"/">>}}, │ {{utf8,<<"durable">>},{boolean,true}}, │ {{utf8,<<"auto_delete">>},{boolean,false}}, │ {{utf8,<<"exclusive">>},{boolean,false}}, │ {{utf8,<<"type">>},{utf8,<<"classic">>}}, │ {{utf8,<<"arguments">>}, │ {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}}, │ {{utf8,<<"replicas">>}, │ {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]}, │ {[{{resource,<<"/">>,queue,<<"cq-145">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-144">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-143">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-142">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-141">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-140">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-139">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-138">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-137">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-136">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-135">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-134">>},configure}], │ []}}} │ [{rabbit_amqp_management,handle_http_req,8, │ [{file,"rabbit_amqp_management.erl"},{line,130}]}, │ {rabbit_amqp_management,handle_request,5, │ [{file,"rabbit_amqp_management.erl"},{line,43}]}, │ {rabbit_amqp_session,incoming_mgmt_link_transfer,3, │ [{file,"rabbit_amqp_session.erl"},{line,2317}]}, │ {rabbit_amqp_session,handle_frame,2, │ [{file,"rabbit_amqp_session.erl"},{line,963}]}, │ {rabbit_amqp_session,handle_cast,2, │ [{file,"rabbit_amqp_session.erl"},{line,539}]}, │ {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]}, │ {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]}, │ {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]} ``` To repro, run the following command in parallel in two separate terminals: ``` ./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic classic ```
mkuratczyk
approved these changes
Apr 11, 2025
mergify bot
pushed a commit
that referenced
this pull request
Apr 11, 2025
* Fix concurrent AMQP queue declarations Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred: ``` │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>, │ {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}}, │ {{utf8,<<"message_count">>},{ulong,0}}, │ {{utf8,<<"consumer_count">>},{uint,0}}, │ {{utf8,<<"name">>},{utf8,<<"cq-145">>}}, │ {{utf8,<<"vhost">>},{utf8,<<"/">>}}, │ {{utf8,<<"durable">>},{boolean,true}}, │ {{utf8,<<"auto_delete">>},{boolean,false}}, │ {{utf8,<<"exclusive">>},{boolean,false}}, │ {{utf8,<<"type">>},{utf8,<<"classic">>}}, │ {{utf8,<<"arguments">>}, │ {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}}, │ {{utf8,<<"replicas">>}, │ {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]}, │ {[{{resource,<<"/">>,queue,<<"cq-145">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-144">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-143">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-142">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-141">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-140">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-139">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-138">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-137">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-136">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-135">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-134">>},configure}], │ []}}} │ [{rabbit_amqp_management,handle_http_req,8, │ [{file,"rabbit_amqp_management.erl"},{line,130}]}, │ {rabbit_amqp_management,handle_request,5, │ [{file,"rabbit_amqp_management.erl"},{line,43}]}, │ {rabbit_amqp_session,incoming_mgmt_link_transfer,3, │ [{file,"rabbit_amqp_session.erl"},{line,2317}]}, │ {rabbit_amqp_session,handle_frame,2, │ [{file,"rabbit_amqp_session.erl"},{line,963}]}, │ {rabbit_amqp_session,handle_cast,2, │ [{file,"rabbit_amqp_session.erl"},{line,539}]}, │ {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]}, │ {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]}, │ {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]} ``` To repro, run the following command in parallel in two separate terminals: ``` ./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic classic ``` * Simplify (cherry picked from commit 6eb1f87)
ansd
added a commit
that referenced
this pull request
Apr 11, 2025
* Fix concurrent AMQP queue declarations Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred: ``` │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>, │ {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}}, │ {{utf8,<<"message_count">>},{ulong,0}}, │ {{utf8,<<"consumer_count">>},{uint,0}}, │ {{utf8,<<"name">>},{utf8,<<"cq-145">>}}, │ {{utf8,<<"vhost">>},{utf8,<<"/">>}}, │ {{utf8,<<"durable">>},{boolean,true}}, │ {{utf8,<<"auto_delete">>},{boolean,false}}, │ {{utf8,<<"exclusive">>},{boolean,false}}, │ {{utf8,<<"type">>},{utf8,<<"classic">>}}, │ {{utf8,<<"arguments">>}, │ {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}}, │ {{utf8,<<"replicas">>}, │ {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]}, │ {[{{resource,<<"/">>,queue,<<"cq-145">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-144">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-143">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-142">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-141">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-140">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-139">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-138">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-137">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-136">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-135">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-134">>},configure}], │ []}}} │ [{rabbit_amqp_management,handle_http_req,8, │ [{file,"rabbit_amqp_management.erl"},{line,130}]}, │ {rabbit_amqp_management,handle_request,5, │ [{file,"rabbit_amqp_management.erl"},{line,43}]}, │ {rabbit_amqp_session,incoming_mgmt_link_transfer,3, │ [{file,"rabbit_amqp_session.erl"},{line,2317}]}, │ {rabbit_amqp_session,handle_frame,2, │ [{file,"rabbit_amqp_session.erl"},{line,963}]}, │ {rabbit_amqp_session,handle_cast,2, │ [{file,"rabbit_amqp_session.erl"},{line,539}]}, │ {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]}, │ {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]}, │ {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]} ``` To repro, run the following command in parallel in two separate terminals: ``` ./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic classic ``` * Simplify (cherry picked from commit 6eb1f87)
mergify bot
pushed a commit
that referenced
this pull request
Apr 11, 2025
* Fix concurrent AMQP queue declarations Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred: ``` │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>, │ {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}}, │ {{utf8,<<"message_count">>},{ulong,0}}, │ {{utf8,<<"consumer_count">>},{uint,0}}, │ {{utf8,<<"name">>},{utf8,<<"cq-145">>}}, │ {{utf8,<<"vhost">>},{utf8,<<"/">>}}, │ {{utf8,<<"durable">>},{boolean,true}}, │ {{utf8,<<"auto_delete">>},{boolean,false}}, │ {{utf8,<<"exclusive">>},{boolean,false}}, │ {{utf8,<<"type">>},{utf8,<<"classic">>}}, │ {{utf8,<<"arguments">>}, │ {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}}, │ {{utf8,<<"replicas">>}, │ {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]}, │ {[{{resource,<<"/">>,queue,<<"cq-145">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-144">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-143">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-142">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-141">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-140">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-139">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-138">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-137">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-136">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-135">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-134">>},configure}], │ []}}} │ [{rabbit_amqp_management,handle_http_req,8, │ [{file,"rabbit_amqp_management.erl"},{line,130}]}, │ {rabbit_amqp_management,handle_request,5, │ [{file,"rabbit_amqp_management.erl"},{line,43}]}, │ {rabbit_amqp_session,incoming_mgmt_link_transfer,3, │ [{file,"rabbit_amqp_session.erl"},{line,2317}]}, │ {rabbit_amqp_session,handle_frame,2, │ [{file,"rabbit_amqp_session.erl"},{line,963}]}, │ {rabbit_amqp_session,handle_cast,2, │ [{file,"rabbit_amqp_session.erl"},{line,539}]}, │ {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]}, │ {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]}, │ {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]} ``` To repro, run the following command in parallel in two separate terminals: ``` ./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic classic ``` * Simplify (cherry picked from commit 6eb1f87) (cherry picked from commit 4cef5a6)
michaelklishin
pushed a commit
that referenced
this pull request
Apr 24, 2025
* Fix concurrent AMQP queue declarations Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred: ``` │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>, │ {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}}, │ {{utf8,<<"message_count">>},{ulong,0}}, │ {{utf8,<<"consumer_count">>},{uint,0}}, │ {{utf8,<<"name">>},{utf8,<<"cq-145">>}}, │ {{utf8,<<"vhost">>},{utf8,<<"/">>}}, │ {{utf8,<<"durable">>},{boolean,true}}, │ {{utf8,<<"auto_delete">>},{boolean,false}}, │ {{utf8,<<"exclusive">>},{boolean,false}}, │ {{utf8,<<"type">>},{utf8,<<"classic">>}}, │ {{utf8,<<"arguments">>}, │ {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}}, │ {{utf8,<<"replicas">>}, │ {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]}, │ {[{{resource,<<"/">>,queue,<<"cq-145">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-144">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-143">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-142">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-141">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-140">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-139">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-138">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-137">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-136">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-135">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-134">>},configure}], │ []}}} │ [{rabbit_amqp_management,handle_http_req,8, │ [{file,"rabbit_amqp_management.erl"},{line,130}]}, │ {rabbit_amqp_management,handle_request,5, │ [{file,"rabbit_amqp_management.erl"},{line,43}]}, │ {rabbit_amqp_session,incoming_mgmt_link_transfer,3, │ [{file,"rabbit_amqp_session.erl"},{line,2317}]}, │ {rabbit_amqp_session,handle_frame,2, │ [{file,"rabbit_amqp_session.erl"},{line,963}]}, │ {rabbit_amqp_session,handle_cast,2, │ [{file,"rabbit_amqp_session.erl"},{line,539}]}, │ {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]}, │ {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]}, │ {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]} ``` To repro, run the following command in parallel in two separate terminals: ``` ./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic classic ``` * Simplify
ikavgo
pushed a commit
that referenced
this pull request
May 5, 2025
* Fix concurrent AMQP queue declarations Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred: ``` │ *Error{Condition: amqp:internal-error, Description: {badmatch,{<<"200">>, │ {map,[{{utf8,<<"leader">>},{utf8,<<"rabbit-2@carrot">>}}, │ {{utf8,<<"message_count">>},{ulong,0}}, │ {{utf8,<<"consumer_count">>},{uint,0}}, │ {{utf8,<<"name">>},{utf8,<<"cq-145">>}}, │ {{utf8,<<"vhost">>},{utf8,<<"/">>}}, │ {{utf8,<<"durable">>},{boolean,true}}, │ {{utf8,<<"auto_delete">>},{boolean,false}}, │ {{utf8,<<"exclusive">>},{boolean,false}}, │ {{utf8,<<"type">>},{utf8,<<"classic">>}}, │ {{utf8,<<"arguments">>}, │ {map,[{{utf8,<<"x-queue-type">>},{utf8,<<"classic">>}}]}}, │ {{utf8,<<"replicas">>}, │ {array,utf8,[{utf8,<<"rabbit-2@carrot">>}]}}]}, │ {[{{resource,<<"/">>,queue,<<"cq-145">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-144">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-143">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-142">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-141">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-140">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-139">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-138">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-137">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-136">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-135">>},configure}, │ {{resource,<<"/">>,queue,<<"cq-134">>},configure}], │ []}}} │ [{rabbit_amqp_management,handle_http_req,8, │ [{file,"rabbit_amqp_management.erl"},{line,130}]}, │ {rabbit_amqp_management,handle_request,5, │ [{file,"rabbit_amqp_management.erl"},{line,43}]}, │ {rabbit_amqp_session,incoming_mgmt_link_transfer,3, │ [{file,"rabbit_amqp_session.erl"},{line,2317}]}, │ {rabbit_amqp_session,handle_frame,2, │ [{file,"rabbit_amqp_session.erl"},{line,963}]}, │ {rabbit_amqp_session,handle_cast,2, │ [{file,"rabbit_amqp_session.erl"},{line,539}]}, │ {gen_server,try_handle_cast,3,[{file,"gen_server.erl"},{line,2371}]}, │ {gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,2433}]}, │ {proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,329}]}], Info: map[]} ``` To repro, run the following command in parallel in two separate terminals: ``` ./omq amqp -x 10000 -t /queues/cq-%d -y 0 -C 0 --queues classic classic ``` * Simplify
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prior to this commit, when AMQP clients declared the same queues concurrently, the following crash occurred:
To repro, run the following command in parallel in two separate terminals: