Commit Graph

58467 Commits

Author SHA1 Message Date
Marcial Rosales b5be85ffab Support explicit foward proxy from oauth2 plugin 2024-12-20 10:05:31 +01:00
Michal Kuratczyk 68de3fdb77
Fix channel crash when publishing to a new stream (#12969)
The following scenario led to a channel crash:
1. Publish to a non-existing stream: `perf-test -y 0 -p -e amq.default -t direct -k stream`
2. Declare the stream: `rabbitmqadmin declare queue name=stream queue_type=stream`

There is no pid yet, so we got a function_clause with `none`
```
{function_clause,
   [{osiris_writer,write,
        [none,<0.877.0>,<<"<0.877.0>_-65ZKFz18ll5lau0phi7CsQ">>,1,
         [[0,"Sp",[192,6,5,"B@@AC"]],
          [0,"Sr",
           [193,38,4,
            [[[163,10,<<"x-exchange">>],[161,0,<<>>]],
             [[163,13,<<"x-routing-key">>],[161,6,<<"stream">>]]]]],
          [0,"Su",[160,12,[<<0,19,252,1,0,0,98,171,20,16,108,167>>]]]]],
        [{file,"src/osiris_writer.erl"},{line,158}]},
    {rabbit_stream_queue,deliver0,4,
        [{file,"rabbit_stream_queue.erl"},{line,540}]},
    {rabbit_stream_queue,'-deliver/3-fun-0-',4,
        [{file,"rabbit_stream_queue.erl"},{line,526}]},
    {lists,foldl,3,[{file,"lists.erl"},{line,2146}]},
    {rabbit_queue_type,'-deliver0/4-fun-5-',5,
        [{file,"rabbit_queue_type.erl"},{line,707}]},
    {maps,fold_1,4,[{file,"maps.erl"},{line,860}]},
    {rabbit_queue_type,deliver0,4,
        [{file,"rabbit_queue_type.erl"},{line,704}]},
    {rabbit_queue_type,deliver,4,
        [{file,"rabbit_queue_type.erl"},{line,662}]}]}
```

Co-authored-by: Karl Nilsson <kjnilsson@gmail.com>
2024-12-20 08:56:25 +01:00
Michael Klishin 3ecbe7b7a2
Document RABBITMQ_METADATA_STORE in CONTRIBUTING.md 2024-12-19 17:40:34 -05:00
Jean-Sébastien Pédron f020eb2a0c
Merge pull request #12985 from rabbitmq/wait-for-etcd-start
rabbitmq_peer_discovery_etcd: Wait for etcd start in system_SUITE
2024-12-19 21:28:30 +01:00
Michael Klishin 38ebcc959c
Merge pull request #12987 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot_kotlin/main/org.springframework.boot-spring-boot-starter-parent-3.4.1
build(deps): bump org.springframework.boot:spring-boot-starter-parent from 3.4.0 to 3.4.1 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot_kotlin
2024-12-19 14:49:13 -05:00
Michael Klishin 817c701756
Merge pull request #12986 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot/main/org.springframework.boot-spring-boot-starter-parent-3.4.1
build(deps): bump org.springframework.boot:spring-boot-starter-parent from 3.4.0 to 3.4.1 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot
2024-12-19 14:49:05 -05:00
Michael Klishin 6f95ebd4c7
Merge pull request #12984 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/org.assertj-assertj-core-3.27.0
build(deps-dev): bump org.assertj:assertj-core from 3.26.3 to 3.27.0 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2024-12-19 14:48:57 -05:00
Michael Klishin 0df6a0afc5
Merge pull request #12983 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.assertj-assertj-core-3.27.0
build(deps-dev): bump org.assertj:assertj-core from 3.26.3 to 3.27.0 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2024-12-19 14:48:48 -05:00
Michael Klishin 880ec7f58e
Merge pull request #12982 from rabbitmq/dependabot/maven/deps/rabbitmq_stream_management/test/http_SUITE_data/main/org.assertj-assertj-core-3.27.0
build(deps-dev): bump org.assertj:assertj-core from 3.26.3 to 3.27.0 in /deps/rabbitmq_stream_management/test/http_SUITE_data
2024-12-19 14:48:36 -05:00
dependabot[bot] 318db21400
build(deps): bump org.springframework.boot:spring-boot-starter-parent
Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.0...v3.4.1)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 19:00:20 +00:00
dependabot[bot] 986716f4b3
build(deps): bump org.springframework.boot:spring-boot-starter-parent
Bumps [org.springframework.boot:spring-boot-starter-parent](https://github.com/spring-projects/spring-boot) from 3.4.0 to 3.4.1.
- [Release notes](https://github.com/spring-projects/spring-boot/releases)
- [Commits](https://github.com/spring-projects/spring-boot/compare/v3.4.0...v3.4.1)

---
updated-dependencies:
- dependency-name: org.springframework.boot:spring-boot-starter-parent
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 18:57:22 +00:00
Jean-Sébastien Pédron d54b2bff3c
rabbitmq_peer_discovery_etcd: Wait for etcd start in system_SUITE
[Why]
It was possible that testcases were executed before the etcd daemon was
ready, leading to test failures.

[How]
There was already a santy check to verify that the etcd daemon was
working correctly, but it was itself a testcase.

This patch moves this code to the etcd start code to wait for it to be
ready.

This replaces the previous workaround of waiting for 2 seconds.

While here, log anything printed to stdout/stderr by etcd after it
exited.

Fixes #12981.
2024-12-19 19:45:55 +01:00
dependabot[bot] 97dc8b0c43
build(deps-dev): bump org.assertj:assertj-core
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.3 to 3.27.0.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.3...assertj-build-3.27.0)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 18:43:34 +00:00
dependabot[bot] f6ee945d72
build(deps-dev): bump org.assertj:assertj-core
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.3 to 3.27.0.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.3...assertj-build-3.27.0)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 18:43:30 +00:00
dependabot[bot] 9c4b89320c
build(deps-dev): bump org.assertj:assertj-core
Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.26.3 to 3.27.0.
- [Release notes](https://github.com/assertj/assertj/releases)
- [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.26.3...assertj-build-3.27.0)

---
updated-dependencies:
- dependency-name: org.assertj:assertj-core
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-19 18:33:48 +00:00
David Ansari c23c632753 Fix etcd test failures
Running
```
make -C deps/rabbitmq_peer_discovery_etcd ct-system
```
on some macOS system causes test failures because the client cannot
connect to etcd:
```
test failed to connect [localhost:2379] by <Gun Down> {down,
                                                       {shutdown,
                                                        econnrefused}}
```

The etcd log file didn't show any error message.
However, the etcd log file showed that the etcd listener got started
after the test case tried to connect.

This commit fixes the test failure.

A better solution would be to use the HTTP API or the etcdctl CLI to
poll the listener status. However, simply waiting for 2 seconds is good
enough for this test suite.
2024-12-19 17:49:47 +01:00
Jean-Sébastien Pédron f9257e8a51
Merge pull request #12979 from rabbitmq/add-feature-flags-testcase-for-issue-12963
rabbit_feature_flags: Add testcase after issue #12963
2024-12-19 17:28:41 +01:00
Jean-Sébastien Pédron ea2c8db2d1
rabbit_feature_flags: Add testcase after issue #12963
[Why]
Up-to RabbitMQ 3.13.x, there was a case where if:
1. you enabled a plugin
2. you enabled its feature flags
3. you disabled the plugin
4. you restarted a node (or upgraded it)

... the node could crash on startup because it had a feature flag marked
as enabled that it didn't know about:

    error:{badmatch,#{feature_flags => ...

        rabbit_ff_controller:-check_one_way_compatibility/2-fun-0-/3, line 514
        lists:all_1/2, line 1520
        rabbit_ff_controller:are_compatible/2, line 496
        rabbit_ff_controller:check_node_compatibility_task1/4, line 437
        rabbit_db_cluster:check_compatibility/1, line 376

This was "fixed" by the new way of keeping the registry in memory
(#10988) because it introduces a slight change of behavior. Indeed, the
old way walked through the `FeatureFlags` map and looked up the state in
the `FeatureStates` map to create the `is_enabled/1` function. The new
way just looks up the state in `FeatureStates`.

[How]
The new testcase succeeds on 4.0.x and `main`, but would fail on 3.13.x
with the aforementionne crash.
2024-12-19 16:33:43 +01:00
Jean-Sébastien Pédron 3bf8c81303
Merge pull request #12966 from rabbitmq/take-feature-flag-callback-definition-from-correct-node
rabbit_feature_flags: Take callback definition from correct node
2024-12-19 16:27:48 +01:00
David Ansari 143f4db2a3
Merge pull request #12980 from rabbitmq/upgrade-gun
Upgrade eetcd and gun
2024-12-19 16:27:11 +01:00
David Ansari 658d9c7c62 Upgrade eetcd and gun
## Why?

To introduce AMQP over WebSocket, we will add gun to the Erlang AMQP
1.0 client. We want to add the latest version of gun for this new
feature. Since rabbitmq_peer_discovery_etcd depends on the outdated
eetcd 0.3.6 which in turn depends on the outdated gun 1.3.3, this commit
first upgrades eetcd and gun.

 ## How?
See https://github.com/zhongwencool/eetcd?tab=readme-ov-file#migration-from-eetcd-03x-to-04x

 ## Breaking Changes

This commit causes the following breaking change:
`rabbitmq.conf` settings
* `cluster_formation.etcd.ssl_options.fail_if_no_peer_cert`
* `cluster_formation.etcd.ssl_options.dh`
* `cluster_formation.etcd.ssl_options.dhfile`

are unsupported because they are not valid `ssl:tls_client_option()`.

See https://github.com/erlang/otp/issues/7497#issuecomment-1636012198
2024-12-19 13:20:28 +00:00
David Ansari 85ec8e01da Fix dialyzer errors 2024-12-19 13:00:43 +00:00
Jean-Sébastien Pédron 3325def8eb
rabbit_feature_flags: Take callback definition from correct node
[Why]
The feature flag controller that is responsible for enabling a feature
flag may be on a node that doesn't know this feature flag. This is
supported by there is a bug when it queries the callback definition for
that feature flag: it uses its own registry which does not have anything
about this feature flag.

This leads to a crash because the `run_callback/5` funtion tries to use
the `undefined` atom returned by the registry as a map:

    crasher:
      initial call: rabbit_ff_controller:init/1
      pid: <0.374.0>
      registered_name: rabbit_ff_controller
      exception error: bad map: undefined
        in function  rabbit_ff_controller:run_callback/5
        in call from rabbit_ff_controller:do_enable/3 (rabbit_ff_controller.erl, line 1244)
        in call from rabbit_ff_controller:update_feature_state_and_enable/2 (rabbit_ff_controller.erl, line 1180)
        in call from rabbit_ff_controller:enable_with_registry_locked/2 (rabbit_ff_controller.erl, line 1050)
        in call from rabbit_ff_controller:enable_many_locked/2 (rabbit_ff_controller.erl, line 991)
        in call from rabbit_ff_controller:enable_many/2 (rabbit_ff_controller.erl, line 979)
        in call from rabbit_ff_controller:updating_feature_flag_states/3 (rabbit_ff_controller.erl, line 307)
        in call from gen_statem:loop_state_callback/11 (gen_statem.erl, line 3735)

[How]
The callback definition is now queried from the first node in the list
given as argument. For the common use case where all nodes know about a
feature flag, the first node is the local one, so there should be no
latency caused by the RPC.

See #12963.
2024-12-19 13:45:27 +01:00
Jean-Sébastien Pédron d8ca61c8ee
Merge pull request #12978 from rabbitmq/fix-function-naming-in-feature-flag-controller
rabbit_feature_flags: Fix function name in the controller
2024-12-19 13:36:46 +01:00
Jean-Sébastien Pédron dbec429fba
rabbit_feature_flags: Fix function name in the controller
[Why]
`state_after_virtual_state()` meant nothing.

`state_after_virtual_reset()` was the name I had in mind.
2024-12-19 11:54:25 +01:00
Michael Klishin 55459bcd0e
Correct a few 4.0.5 release notes typos 2024-12-18 16:10:13 -05:00
Jean-Sébastien Pédron 4e6ab725df
Merge pull request #12737 from rabbitmq/improve-metadata-store-selection-in-rabbitmq_ct_helpers
rabbitmq_ct_helpers: Change how Mnesia/Khepri is selected
2024-12-18 14:26:56 +01:00
Jean-Sébastien Pédron 7a9eef17ef
GitHub Actions: Test mixed-version clusters against RabbitMQ 4.0.5
... instead of 4.0.3.

[Why]
We need the following bugfixes:
* one in the Khepri reset code backported in #12739 and published in
  RabbitMQ 4.0.4.
* one in the quorum queue code backported in #12850 and published in
  RabbitMQ 4.0.5.
2024-12-17 09:58:36 +01:00
Jean-Sébastien Pédron debe2a118c
rabbitmq_ct_helpers: Change how Mnesia/Khepri is selected
[Why]
Once `khepr_db` is enabled by default, we need another way to disable it
to select Mnesia instead.

[How]
We use the new relative forced feature flags mechanism to indicate if we
want to explicitly enable or disable `khepri_db`. This way, we don't
touch other stable feature flags and only mess with Khepri.

However, this mechanism is not supported by RabbitMQ 4.0.x and older.
They will ignore the setting. Therefore, to make this work in
mixed-version testing, we set the `$RABBITMQ_FEATURE_FLAGS` variable for
the secondary umbrella. This part will go away once we test against
RabbitMQ 4.1.x as the secondary umbrella in the future.

At the end, we compare the effective metadata store to the expected one.
If they don't match, we skip the test.

While here, change `rjms_topic_selector_SUITE` to only choose Khepri
without specifying any feature flags.
2024-12-17 09:56:54 +01:00
Michael Klishin f413880336
Merge pull request #12960 from rabbitmq/actions-setup-dotnet
Remove actions/setup-dotnet
2024-12-16 16:26:23 -05:00
David Ansari 6916f1c490 Remove actions/setup-dotnet
According to https://github.com/rabbitmq/rabbitmq-server/pull/12955#pullrequestreview-2506932356
and https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md#net-tools
dotnet 8.0 is already installed on Ubuntu 24.04.
2024-12-16 21:37:06 +01:00
Michael Klishin 5981ecf334
Merge pull request #12957 from rabbitmq/dependabot/maven/deps/rabbitmq_stream_management/test/http_SUITE_data/main/junit.jupiter.version-5.11.4
Bump junit.jupiter.version from 5.11.3 to 5.11.4 in /deps/rabbitmq_stream_management/test/http_SUITE_data
2024-12-16 14:01:29 -05:00
Michael Klishin d9582d34da
Merge pull request #12958 from rabbitmq/dependabot/maven/deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot/main/org.junit.jupiter-junit-jupiter-params-5.11.4
Bump org.junit.jupiter:junit-jupiter-params from 5.11.3 to 5.11.4 in /deps/rabbitmq_auth_backend_http/examples/rabbitmq_auth_backend_spring_boot
2024-12-16 14:01:20 -05:00
Michael Klishin b44ad1e6b9
Merge pull request #12959 from rabbitmq/dependabot/maven/deps/rabbitmq_mqtt/test/java_SUITE_data/main/org.junit.jupiter-junit-jupiter-5.11.4
Bump org.junit.jupiter:junit-jupiter from 5.11.3 to 5.11.4 in /deps/rabbitmq_mqtt/test/java_SUITE_data
2024-12-16 14:01:10 -05:00
dependabot[bot] 035ab8d1da
Bump org.junit.jupiter:junit-jupiter
Bumps [org.junit.jupiter:junit-jupiter](https://github.com/junit-team/junit5) from 5.11.3 to 5.11.4.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 18:55:00 +00:00
dependabot[bot] 2e493a91b0
Bump org.junit.jupiter:junit-jupiter-params
Bumps [org.junit.jupiter:junit-jupiter-params](https://github.com/junit-team/junit5) from 5.11.3 to 5.11.4.
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 18:30:43 +00:00
dependabot[bot] 437070c22a
Bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.3 to 5.11.4.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.3 to 5.11.4
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.3 to 5.11.4
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 18:22:15 +00:00
Michael Klishin a19f4ee3d4
Merge pull request #12956 from rabbitmq/dependabot/maven/deps/rabbitmq_stream/test/rabbit_stream_SUITE_data/main/junit.jupiter.version-5.11.4
Bump junit.jupiter.version from 5.11.3 to 5.11.4 in /deps/rabbitmq_stream/test/rabbit_stream_SUITE_data
2024-12-16 13:11:09 -05:00
dependabot[bot] 453c54952b
Bump junit.jupiter.version
Bumps `junit.jupiter.version` from 5.11.3 to 5.11.4.

Updates `org.junit.jupiter:junit-jupiter-engine` from 5.11.3 to 5.11.4
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

Updates `org.junit.jupiter:junit-jupiter-params` from 5.11.3 to 5.11.4
- [Release notes](https://github.com/junit-team/junit5/releases)
- [Commits](https://github.com/junit-team/junit5/compare/r5.11.3...r5.11.4)

---
updated-dependencies:
- dependency-name: org.junit.jupiter:junit-jupiter-engine
  dependency-type: direct:development
  update-type: version-update:semver-patch
- dependency-name: org.junit.jupiter:junit-jupiter-params
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-16 18:08:35 +00:00
Michael Klishin 0db3d7b014
Merge pull request #12950 from rabbitmq/qq-handle-tick
Quorum queues: ignore handle_tick with an old overview format
2024-12-16 11:31:55 -05:00
Michael Klishin 62ce1c954a
Merge pull request #12948 from rabbitmq/fix-flakes
Test fixes for a few more CI flakes
2024-12-16 11:24:10 -05:00
David Ansari e2a113605d Disallow transient entities in RabbitMQ AMQP 1.0 Erlang client
Transient (i.e. `durable=false`) exchanges and queues are deprecated.

Khepri will store all entities durably.
(Even exclusive queues will be stored durably. Exclusive queues are
still deleted when the declaring connection is closed.)

Similar to how the RabbitMQ AMQP 1.0 Java client already disallows the
creation of transient exchanges and queues, this commit will prohibit
the declaration of transient exchanges and queues in the RabbitMQ
AMQP 1.0 Erlang client starting with RabbitMQ 4.1.
2024-12-16 16:17:55 +01:00
Diana Parra Corbacho a97ec92785 Quorum queues: ignore handle_tick with an old overview format
If handle_tick is called before the machine has finished the upgrade
process, it could receive an old overview format (stats tuple vs map).
Let's ignore it and the next handle tick should be fine.

Unlikely to happen in production, detected on CI with a very low tick timeout
2024-12-16 15:39:39 +01:00
Diana Parra Corbacho fe7a141331 Test: Increase receive timeout in all rabbit test suites 2024-12-16 11:58:05 +01:00
Diana Parra Corbacho 43cfc3c937 Tests: Increase receive-after timeout in all mqtt test suites 2024-12-16 11:58:05 +01:00
Diana Parra Corbacho bdaa31e7ea Tests: catch exception on connection closed
The tests force closing the connection with an error
2024-12-16 11:58:05 +01:00
Diana Parra Corbacho 40cb4f46e8 Tests: rabbit_prometheus_http_SUITE longer wait 2024-12-16 11:58:05 +01:00
Michael Klishin 96ebce8c00
4.0.5 release notes update 2024-12-15 23:03:10 -05:00
Michael Klishin 8ff8ce8d8e
Merge pull request #12945 from rabbitmq/mk-4.0.5-release-notes
4.0.5 release notes
2024-12-15 22:46:05 -05:00
Michael Klishin 11e5de0972
4.0.5 release notes 2024-12-15 22:45:38 -05:00