Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/workflows/oci-make.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ on:
# a tag of the erlang image, see https://hub.docker.com/_/erlang for available tags
# also used in the setup-beam step (same tag should work for both)
description: OTP version (eg. `26`, `26.2.5.6`)
default: 27
default: 28
build_arm:
description: Build for ARM64 as well?
type: boolean
Expand All @@ -36,7 +36,7 @@ jobs:
strategy:
matrix:
otp_version:
- ${{ github.event.inputs.otp_version || '27' }}
- ${{ github.event.inputs.otp_version || '28' }}
runs-on: ubuntu-latest
outputs:
# When dependabot, or a user from a fork, creates PRs, secrets are not injected, and the OCI workflow can't push the image
Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:
fail-fast: false
matrix:
otp_version:
- ${{ github.event.inputs.otp_version || '27' }}
- ${{ github.event.inputs.otp_version || '28' }}
needs: build-package-generic-unix
runs-on: ubuntu-latest
if: ${{ needs.build-package-generic-unix.outputs.authorized }} == 'true'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/peer-discovery-aws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
env:
OTP_VERSION: "27"
OTP_VERSION: "28"
jobs:
peer-discovery-aws-integration-test:
name: Integration Test
Expand Down Expand Up @@ -48,10 +48,10 @@ jobs:
polling-seconds: 60
- name: CONFIGURE OTP & ELIXIR
if: steps.authorized.outputs.authorized == 'true'
uses: erlef/setup-beam@v1.17
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: "1.17"
elixir-version: "1.18"
- name: SETUP ecs-cli
if: steps.authorized.outputs.authorized == 'true'
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-authnz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
uses: actions/checkout@v4

- name: Configure OTP & Elixir
uses: erlef/setup-beam@v1.17
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang_version }}
elixir-version: ${{ matrix.elixir_version }}
Expand Down
22 changes: 21 additions & 1 deletion .github/workflows/test-make-target.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,13 @@ jobs:
- name: FETCH TAGS
run: git fetch --tags

- name: EXTRACT ACTIVEMQ VERSION
if: inputs.plugin == 'amqp10_client'
run: |
awk '/^ACTIVEMQ_VERSION/ {print $1 "=" $3}' deps/amqp10_client/Makefile >> $GITHUB_ENV

- name: SETUP OTP & ELIXIR
uses: erlef/setup-beam@v1.17
uses: erlef/setup-beam@v1
with:
otp-version: ${{ inputs.erlang_version }}
elixir-version: ${{ inputs.elixir_version }}
Expand Down Expand Up @@ -99,12 +104,27 @@ jobs:
docker run -d --network host --name erlang_low_version erlang:${LOW_ERLANG_VERSION} \
erl -sname rabbit_fifo_prop@localhost -setcookie $(cat ~/.erlang.cookie) -noinput

- name: RESTORE ACTIVEMQ FROM CACHE
if: inputs.plugin == 'amqp10_client'
uses: actions/cache/restore@v4
id: cache-activemq-restore
with:
path: deps/amqp10_client/test/system_SUITE_data/apache-activemq-${{ env.ACTIVEMQ_VERSION }}-bin.tar.gz
key: activemq-${{ env.ACTIVEMQ_VERSION }}

- name: RUN TESTS
if: inputs.plugin != 'rabbitmq_cli'
run: |
sudo netstat -ntp
make -C deps/${{ inputs.plugin }} ${{ inputs.make_target }} RABBITMQ_METADATA_STORE=${{ inputs.metadata_store }}

- name: CACHE ACTIVEMQ
uses: actions/cache/save@v4
if: inputs.plugin == 'amqp10_client' && steps.cache-activemq-restore.outputs.cache-hit != 'true'
with:
path: deps/amqp10_client/test/system_SUITE_data/apache-activemq-${{ env.ACTIVEMQ_VERSION }}-bin.tar.gz
key: activemq-${{ env.ACTIVEMQ_VERSION }}

# rabbitmq_cli needs a correct broker version for two of its tests.
# But setting PROJECT_VERSION makes other plugins fail.
- name: RUN TESTS (rabbitmq_cli)
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/test-make-type-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
plugin:
# These are using plugin-specific test jobs.
- rabbit
- rabbitmq_mqtt
# - rabbitmq_mqtt # disabled due to Elixir 1.18 JSON conficts
- rabbitmq_peer_discovery_aws
# These are from the test-plugin test job.
- amqp10_client
Expand Down Expand Up @@ -57,14 +57,14 @@ jobs:
- rabbitmq_shovel
- rabbitmq_shovel_management
- rabbitmq_shovel_prometheus
- rabbitmq_stomp
- rabbitmq_stream
# - rabbitmq_stomp # disabled due to Elixir 1.18 JSON conficts
# - rabbitmq_stream # disabled due to Elixir 1.18 JSON conficts
- rabbitmq_stream_common
- rabbitmq_stream_management
- rabbitmq_tracing
- rabbitmq_trust_store
- rabbitmq_web_dispatch
- rabbitmq_web_mqtt
# - rabbitmq_web_mqtt # disabled due to Elixir 1.18 JSON conficts
- rabbitmq_web_stomp
# This one we do not want to run tests so no corresponding test job.
- rabbitmq_ct_helpers
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/test-make.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ jobs:
erlang_version:
- '26'
- '27'
- '28'
elixir_version:
- '1.17'
- '1.18'
# @todo Add macOS and Windows.
runs-on: ubuntu-latest
timeout-minutes: 60
Expand All @@ -36,7 +37,7 @@ jobs:
run: git fetch --tags

- name: SETUP OTP & ELIXIR
uses: erlef/setup-beam@v1.17
uses: erlef/setup-beam@v1.19
with:
otp-version: ${{ matrix.erlang_version }}
elixir-version: ${{ matrix.elixir_version }}
Expand All @@ -62,9 +63,9 @@ jobs:
fail-fast: false
matrix:
erlang_version:
- '27'
- '28'
elixir_version:
- '1.17'
- '1.18'
metadata_store:
- mnesia
- khepri
Expand All @@ -81,9 +82,9 @@ jobs:
fail-fast: false
matrix:
erlang_version:
- '27'
- '28'
elixir_version:
- '1.17'
- '1.18'
metadata_store:
- mnesia
- khepri
Expand All @@ -100,9 +101,9 @@ jobs:
fail-fast: false
matrix:
erlang_version: # Latest OTP
- '27'
- '28'
elixir_version: # Latest Elixir
- '1.17'
- '1.18'
uses: ./.github/workflows/test-make-type-check.yaml
with:
erlang_version: ${{ matrix.erlang_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-management-ui-for-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/checkout@v4

- name: Configure OTP & Elixir
uses: erlef/setup-beam@v1.17
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang_version }}
elixir-version: ${{ matrix.elixir_version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-management-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@v4

- name: Configure OTP & Elixir
uses: erlef/setup-beam@v1.17
uses: erlef/setup-beam@v1
with:
otp-version: ${{ matrix.erlang_version }}
elixir-version: ${{ matrix.elixir_version }}
Expand Down
4 changes: 2 additions & 2 deletions deps/rabbit/src/rabbit_networking.erl
Original file line number Diff line number Diff line change
Expand Up @@ -610,13 +610,13 @@ ranch_handshake(Ref) ->
tune_buffer_size(Sock, dynamic_buffer) ->
case rabbit_net:setopts(Sock, [{buffer, 128}]) of
ok -> ok;
{error, _} -> rabbit_net:fast_close(Sock),
{error, _} -> _ = rabbit_net:fast_close(Sock),
exit(normal)
end;
tune_buffer_size(Sock, static_buffer) ->
case tune_buffer_size_static(Sock) of
ok -> ok;
{error, _} -> rabbit_net:fast_close(Sock),
{error, _} -> _ = rabbit_net:fast_close(Sock),
exit(normal)
end.

Expand Down
8 changes: 4 additions & 4 deletions deps/rabbit/src/rabbit_reader.erl
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ socket_op(Sock, Fun) ->
case Fun(Sock) of
{ok, Res} -> Res;
{error, Reason} -> socket_error(Reason),
rabbit_net:fast_close(RealSocket),
_ = rabbit_net:fast_close(RealSocket),
exit(normal)
end.

Expand All @@ -287,10 +287,10 @@ start_connection(Parent, HelperSups, RanchRef, Deb, Sock) ->
RealSocket = rabbit_net:unwrap_socket(Sock),
Name = case rabbit_net:connection_string(Sock, inbound) of
{ok, Str} -> list_to_binary(Str);
{error, enotconn} -> rabbit_net:fast_close(RealSocket),
{error, enotconn} -> _ = rabbit_net:fast_close(RealSocket),
exit(normal);
{error, Reason} -> socket_error(Reason),
rabbit_net:fast_close(RealSocket),
_ = rabbit_net:fast_close(RealSocket),
exit(normal)
end,
{ok, HandshakeTimeout} = application:get_env(rabbit, handshake_timeout),
Expand Down Expand Up @@ -364,7 +364,7 @@ start_connection(Parent, HelperSups, RanchRef, Deb, Sock) ->
%% 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_net:fast_close(RealSocket),
rabbit_networking:unregister_connection(self()),
rabbit_core_metrics:connection_closed(self()),
ClientProperties = case get(client_properties) of
Expand Down
76 changes: 41 additions & 35 deletions deps/rabbit/test/per_user_connection_tracking_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -100,60 +100,64 @@ end_per_testcase(Testcase, Config) ->
%% Test cases.
%% -------------------------------------------------------------------
single_node_list_of_user(Config) ->
Username = proplists:get_value(rmq_username, Config),
Username2 = <<"guest2">>,
Username1 = list_to_binary(atom_to_list(?FUNCTION_NAME) ++ "-1"),
Username2 = list_to_binary(atom_to_list(?FUNCTION_NAME) ++ "-2"),

Vhost = proplists:get_value(rmq_vhost, Config),

rabbit_ct_broker_helpers:add_user(Config, Username2),
rabbit_ct_broker_helpers:set_full_permissions(Config, Username2, Vhost),
[ begin
rabbit_ct_broker_helpers:add_user(Config, U),
rabbit_ct_broker_helpers:set_full_permissions(Config, U, Vhost)
end || U <- [Username1, Username2]],

?assertEqual(0, count_connections_in(Config, Username)),
?assertEqual(0, count_connections_in(Config, Username1)),
?assertEqual(0, count_connections_in(Config, Username2)),

[Conn1] = open_connections(Config, [0]),
?awaitMatch(1, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username}] = connections_in(Config, Username),
[Conn1] = open_connections(Config, [{0, Username1}]),
?awaitMatch(1, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username1}] = connections_in(Config, Username1),
close_connections([Conn1]),
?awaitMatch(0, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
?awaitMatch(0, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),

[Conn2] = open_connections(Config, [{0, Username2}]),
?awaitMatch(1, count_connections_in(Config, Username2), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username2}] = connections_in(Config, Username2),

[Conn3] = open_connections(Config, [0]),
?awaitMatch(1, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username}] = connections_in(Config, Username),
[Conn3] = open_connections(Config, [{0, Username1}]),
?awaitMatch(1, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username1}] = connections_in(Config, Username1),

[Conn4] = open_connections(Config, [0]),
[Conn4] = open_connections(Config, [{0, Username1}]),
kill_connections([Conn4]),
?awaitMatch(1, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username}] = connections_in(Config, Username),
?awaitMatch(1, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),
[#tracked_connection{username = Username1}] = connections_in(Config, Username1),

[Conn5] = open_connections(Config, [0]),
?awaitMatch(2, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
[Username, Username] =
[Conn5] = open_connections(Config, [{0, Username1}]),
?awaitMatch(2, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),
[Username1, Username1] =
lists:map(fun (#tracked_connection{username = U}) -> U end,
connections_in(Config, Username)),
connections_in(Config, Username1)),

close_connections([Conn2, Conn3, Conn5]),
rabbit_ct_broker_helpers:delete_user(Config, Username2),
?awaitMatch(0, length(all_connections(Config)), ?AWAIT_TIMEOUT).

single_node_user_deletion_forces_connection_closure(Config) ->
Username = proplists:get_value(rmq_username, Config),
Username2 = <<"guest2">>,
Username1 = list_to_binary(atom_to_list(?FUNCTION_NAME) ++ "-1"),
Username2 = list_to_binary(atom_to_list(?FUNCTION_NAME) ++ "-2"),

Vhost = proplists:get_value(rmq_vhost, Config),

rabbit_ct_broker_helpers:add_user(Config, Username2),
rabbit_ct_broker_helpers:set_full_permissions(Config, Username2, Vhost),
[ begin
rabbit_ct_broker_helpers:add_user(Config, U),
rabbit_ct_broker_helpers:set_full_permissions(Config, U, Vhost)
end || U <- [Username1, Username2]],

?assertEqual(0, count_connections_in(Config, Username)),
?assertEqual(0, count_connections_in(Config, Username1)),
?assertEqual(0, count_connections_in(Config, Username2)),

[Conn1] = open_connections(Config, [0]),
?awaitMatch(1, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
[Conn1] = open_connections(Config, [{0, Username1}]),
?awaitMatch(1, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),

[_Conn2] = open_connections(Config, [{0, Username2}]),
?awaitMatch(1, count_connections_in(Config, Username2), ?AWAIT_TIMEOUT),
Expand All @@ -162,22 +166,24 @@ single_node_user_deletion_forces_connection_closure(Config) ->
?awaitMatch(0, count_connections_in(Config, Username2), ?AWAIT_TIMEOUT),

close_connections([Conn1]),
?awaitMatch(0, count_connections_in(Config, Username), ?AWAIT_TIMEOUT).
?awaitMatch(0, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT).

cluster_user_deletion_forces_connection_closure(Config) ->
Username = proplists:get_value(rmq_username, Config),
Username2 = <<"guest2">>,
Username1 = list_to_binary(atom_to_list(?FUNCTION_NAME) ++ "-1"),
Username2 = list_to_binary(atom_to_list(?FUNCTION_NAME) ++ "-2"),

Vhost = proplists:get_value(rmq_vhost, Config),

rabbit_ct_broker_helpers:add_user(Config, Username2),
rabbit_ct_broker_helpers:set_full_permissions(Config, Username2, Vhost),
[ begin
rabbit_ct_broker_helpers:add_user(Config, U),
rabbit_ct_broker_helpers:set_full_permissions(Config, U, Vhost)
end || U <- [Username1, Username2]],

?assertEqual(0, count_connections_in(Config, Username)),
?assertEqual(0, count_connections_in(Config, Username1)),
?assertEqual(0, count_connections_in(Config, Username2)),

[Conn1] = open_connections(Config, [{0, Username}]),
?awaitMatch(1, count_connections_in(Config, Username), ?AWAIT_TIMEOUT),
[Conn1] = open_connections(Config, [{0, Username1}]),
?awaitMatch(1, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT),

[_Conn2] = open_connections(Config, [{1, Username2}]),
?awaitMatch(1, count_connections_in(Config, Username2), ?AWAIT_TIMEOUT),
Expand All @@ -186,7 +192,7 @@ cluster_user_deletion_forces_connection_closure(Config) ->
?awaitMatch(0, count_connections_in(Config, Username2), ?AWAIT_TIMEOUT),

close_connections([Conn1]),
?awaitMatch(0, count_connections_in(Config, Username), ?AWAIT_TIMEOUT).
?awaitMatch(0, count_connections_in(Config, Username1), ?AWAIT_TIMEOUT).

%% -------------------------------------------------------------------
%% Helpers
Expand Down
Loading