Skip to content
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

Make CI: Fix more flakes #12538

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions deps/rabbit/src/rabbit_reader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,6 @@ start_connection(Parent, HelperSups, RanchRef, Deb, Sock) ->
ConnNameEx = dynamic_connection_name(Name),
log_connection_exception(ConnNameEx, ConnectedAt, Ex)
after
%% We don't call gen_tcp:close/1 here since it waits for
%% pending output to be sent, which results in unnecessary
%% delays.
rabbit_net:fast_close(RealSocket),
rabbit_networking:unregister_connection(self()),
rabbit_core_metrics:connection_closed(self()),
ClientProperties = case get(client_properties) of
Expand All @@ -383,7 +379,12 @@ start_connection(Parent, HelperSups, RanchRef, Deb, Sock) ->
ConnectionUserProvidedName ->
[{user_provided_name, ConnectionUserProvidedName} | EventProperties]
end,
rabbit_event:notify(connection_closed, EventProperties1)
rabbit_event:notify(connection_closed, EventProperties1),

%% We don't call gen_tcp:close/1 here since it waits for
%% pending output to be sent, which results in unnecessary
%% delays.
rabbit_net:fast_close(RealSocket)
end,
done.

Expand Down Expand Up @@ -1252,7 +1253,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 +1276,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
4 changes: 4 additions & 0 deletions deps/rabbitmq_management/test/clustering_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,8 @@ queue_with_multiple_consumers(Config) ->
end,

force_stats(Config),
?awaitMatch(#{consumer_details := [_, _|_]},
http_get(Config, "/queues/%2F/multi-consumer-queue1"), 60000),

Res = http_get(Config, "/queues/%2F/multi-consumer-queue1"),
http_delete(Config, "/queues/%2F/multi-consumer-queue1", ?NO_CONTENT),
Expand Down Expand Up @@ -519,6 +521,8 @@ consumers(Config) ->
consume(Chan2, <<"some-queue">>),

force_stats(Config),
?awaitMatch([_, _|_], http_get(Config, "/consumers"), 60000),

Res = http_get(Config, "/consumers"),

% assert there are two non-empty consumer records
Expand Down
Loading