Skip to content

Commit

Permalink
AMQP 0.9: Send the connection.open_ok after all init
Browse files Browse the repository at this point in the history
This is an attempt to solve flakes WIP
  • Loading branch information
lhoguin committed Oct 18, 2024
1 parent ee578e8 commit 250eb10
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deps/rabbit/src/rabbit_reader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,6 @@ handle_method0(#'connection.open'{virtual_host = VHost},
ok = rabbit_access_control:check_vhost_access(User, VHost, {socket, Sock}, #{}),
ok = is_vhost_alive(VHost, User),
NewConnection = Connection#connection{vhost = VHost},
ok = send_on_channel0(Sock, #'connection.open_ok'{}, Protocol),

Alarms = rabbit_alarm:register(self(), {?MODULE, conserve_resources, []}),
BlockedBy = sets:from_list([{resource, Alarm} || Alarm <- Alarms]),
Expand All @@ -1276,6 +1275,9 @@ handle_method0(#'connection.open'{virtual_host = VHost},
rabbit_log_connection:info(
"connection ~ts: user '~ts' authenticated and granted access to vhost '~ts'",
[dynamic_connection_name(ConnName), Username, VHost]),

ok = send_on_channel0(Sock, #'connection.open_ok'{}, Protocol),

State1;
handle_method0(#'connection.close'{}, State) when ?IS_RUNNING(State) ->
lists:foreach(fun rabbit_channel:shutdown/1, all_channels()),
Expand Down

0 comments on commit 250eb10

Please sign in to comment.