Commit Graph

58404 Commits

Author SHA1 Message Date
Michal Kuratczyk 16a2694f34
WIP 2024-12-12 18:40:45 +01:00
Michal Kuratczyk 7a227e8f43
debug logs 2024-12-12 15:24:20 +01:00
David Ansari 9d8ae14e27 Use correct AMQP filter expression string modifier prefix
Section 4.1.1 of AMQP Filter Expressions Working Draft 09
defines `&` (ampersand) instead of `$` (dollar) as the string modifier prefix.
2024-12-11 16:48:56 +01:00
Michael Klishin fc4a6915bb
Update 4.1.0.md 2024-12-10 21:50:18 -05:00
Michael Klishin 0ebef2a72f
Release notes: 4.1.0-beta.3 is out, bump to 4.1.0-beta.4 2024-12-10 20:19:03 -05:00
Michael Klishin dbd03d7248
List #10519 #12564 in 4.1.0 release notes 2024-12-10 20:04:47 -05:00
Michael Klishin 8bb4719de8
4.1.0 release notes updates 2024-12-10 19:57:44 -05:00
Michael Klishin b84483ab5c
Merge pull request #12907 from rabbitmq/rabbitmq-server-12906
By @gomoripeti: Restore credit_flow between AMQP 0.9.1 channel/MQTT connection -> CQ processes
2024-12-10 10:03:47 -05:00
David Ansari 0d34ef6047 Set a floor of zero for incoming-window
Prior to this commit, when the sending client overshot RabbitMQ's incoming-window
(which is allowed in the event of a cluster wide memory or disk alarm),
and RabbitMQ sent a FLOW frame to the client, RabbitMQ sent a negative
incoming-window field in the FLOW frame causing the following crash in
the writer proc:
```
crasher:
  initial call: rabbit_amqp_writer:init/1
  pid: <0.19353.0>
  registered_name: []
  exception error: bad argument
    in function  iolist_size/1
       called as iolist_size([<<112,0,0,23,120>>,
                              [82,-15],
                              <<"pÿÿÿü">>,<<"pÿÿÿÿ">>,67,
                              <<112,0,0,23,120>>,
                              "Rª",64,64,64,64])
       *** argument 1: not an iodata term
    in call from amqp10_binary_generator:generate1/1 (amqp10_binary_generator.erl, line 141)
    in call from amqp10_binary_generator:generate1/1 (amqp10_binary_generator.erl, line 88)
    in call from amqp10_binary_generator:generate/1 (amqp10_binary_generator.erl, line 79)
    in call from rabbit_amqp_writer:assemble_frame/3 (rabbit_amqp_writer.erl, line 206)
    in call from rabbit_amqp_writer:internal_send_command_async/3 (rabbit_amqp_writer.erl, line 189)
    in call from rabbit_amqp_writer:handle_cast/2 (rabbit_amqp_writer.erl, line 110)
    in call from gen_server:try_handle_cast/3 (gen_server.erl, line 1121)
```

This commit fixes this crash by maintaning a floor of zero for
incoming-window in the FLOW frame.

Fixes #12816
2024-12-10 09:39:21 +01:00
Michael Klishin f3540ee7d2
web_mqtt_shared_SUITE: propagate flow_classic_queue to mqtt_shared_SUITE #12907 12906 2024-12-09 23:13:55 -05:00
Péter Gömöri 321039c353
fixup: Add rabbit_misc:process_info/2 that also works for remote PIDs
Co-authored-by: Luke Bakken <lukerbakken@gmail.com>
(cherry picked from commit 095f702093)
2024-12-09 22:33:54 -05:00
Péter Gömöri 2c1f1a1387
Restore credit_flow between channel/MQTT connection -> CQ processes
The credit_flow between publishing AMQP 0.9.1 channel (or MQTT
connection) and (non-mirrored) classic queue processes was
unintentionally removed in 4.0 together with anything else related to
CQ mirroring.

By default we restore the 3.x behaviour for non-mirored classic
queues. It is possible to disable flow-control (the earlier 4.0.x
behaviour) with the new env `classic_queue_flow_control`. In 3.x this
was possible with the config `mirroring_flow_control`.

(cherry picked from commit d65bd7d07a)
2024-12-09 22:33:47 -05:00
Péter Gömöri e777c0b263
Add rabbit_misc:process_info/2 that also works for remote PIDs
(cherry picked from commit 7b7708f367)
2024-12-09 22:33:38 -05:00
Michael Klishin c15ba8e229
Wording 2024-12-07 02:24:08 -05:00
Michael Klishin cbe8e2bb97
Discussions: modify [Question] template
Too many people check the box that says they
have read the community support policy but they
haven't actually read anything because
they expect support for RabbitMQ 3.13 and earlier
3.x versions without having a support license
or being regular contributors.
2024-12-07 02:21:37 -05:00
Michael Klishin d6859988c1
4.0.4 release notes: typos 2024-12-06 22:03:21 -05:00
Michael Klishin 9fb0136513
Merge pull request #12894 from rabbitmq/md/cli-warnings
CLI: Error on compiler warnings in tests
2024-12-04 14:41:26 -05:00
Michael Klishin 9b6ab77f87
CLI: test/diagnostics cosmetics #12894 2024-12-04 13:44:29 -05:00
Michael Davis 430cd2f578
CLI: Compile and test with --warnings-as-errors 2024-12-04 11:19:55 -05:00
Michael Davis 9f60325563
CLI: Silence `status` command test
This check is expected to succeed and the status is expected to be
printed to stdout rather than stderr. This change silences the status
output. The status text was printed mistakenly previously because we
captured stderr rather than stdout.
2024-12-04 11:10:46 -05:00
Michael Davis c328922a2a
CLI: Fix match of discover peers command test
This previously emitted a warning because Elixir will rebind `this_node`
by default, so the `this_node` binding in the line above was unused.
(As opposed to Erlang which would treat this as a match - rejecting
the binding if `this_node` was not equal to the value being matched.)
The node needed to be adjusted as well - `node()` returned the ExUnit
runner's node while the command returned the remote node, which is
stored in the context under `opts.node`.
2024-12-04 11:07:46 -05:00
Michael Davis d58d874a0b
CLI: Resolve elixirc warnings 2024-12-04 11:07:34 -05:00
Michael Klishin 28b0b05ba0
Merge pull request #12889 from rabbitmq/rabbitmq-server-12888
By @bpint: Fixes an exception in AMQP 0-9-1 exception (error) generator when input data includes non-ASCII characters
2024-12-03 23:35:44 -05:00
Michael Klishin 9b1953994e
One more test case for #12888 2024-12-03 23:07:58 -05:00
Ace Breakpoint ee41983e84 Fix crash caused by mishandling of non-ascii amqp_error explaination
`rabbit_binary_generator:map_exception/3` will crash when there are
unicode characters in the `explaination` field of `Reason#amqp_error`
parameter. The explaination string (list) is assumed to be ascii, with
each character/member in the range of a byte. Any unicode characters
in the string will trigger `badarg` crash of `list_to_binary/1` in
`rabbit_binary_generator:amqp_exception_explanation/2`.

Amqp091 shovel crash due to this is reported,
https://github.com/rabbitmq/rabbitmq-server/discussions/12874
When a queue as shovel source/destination does not exist, and its
name contains non-ascii characters, the explaination of amqp_error
will be like `no queue non_ascii_name_😍 in vhost /`. It will
subsequently crash and even affect management console.

To fix this, `unicode:characters_to_binary/1` is used instead of
`list_to_binary/1`, and unicode-safe truncation of long explaination
with `io_lib:format/3` chars_limit replaces direct bytes truncation.
2024-12-04 10:39:16 +08:00
Michael Davis 38091430b5
make: Suppress Elixir charlist warning for dialyze target
The `:io.format/2` call was originally passed a single-quote string
(i.e. a charlist in Elixir terminology) which emits a warning in more
recent Elixir versions:

    warning: single-quoted strings represent charlists. Use ~c"" if you indeed want a charlist or use "" instead
    └─ nofile:1:12

This warning would pop up a few times when using `make dialyze` within
a deps directory. To resolve it we can switch the quoting so that the
eval string is wrapped in single quotes (equivalent for shell since this
line doesn't use variables) and the format argument is wrapped in double
quotes. This uses a binary in Elixir instead, but that's ok because
`io:format/3`'s `io:format()` parameter may either be an atom, string,
or binary.

This trick was copied from Makefile:49 which uses the same quoting.
2024-12-03 12:02:25 -05:00
Michael Klishin bdb8ff24d9
Update COMMUNITY_SUPPORT.md 2024-12-03 11:03:34 -05:00
Michael Klishin af0379dec8
Update COMMUNITY_SUPPORT.md 2024-12-03 10:50:15 -05:00
Jean-Sébastien Pédron 658d5b889d
Merge pull request #12870 from rabbitmq/fixes-to-cli-tests-related-to-khepri
rabbitmq_cli: Prepare tests to run against a node with Khepri enabled by default
2024-12-02 14:33:21 +01:00
Jean-Sébastien Pédron 112ff3f3f5
rabbitmq_cli: Prepare tests to run against a node with Khepri enabled by default 2024-12-02 13:55:41 +01:00
Jean-Sébastien Pédron 16fa401cf2
Merge pull request #12869 from rabbitmq/return-error-from-force-load-with-khepri
rabbit_db: Return error from `force_boot_command_test/0` with Khepri
2024-12-02 13:55:16 +01:00
Jean-Sébastien Pédron 56f90a51a9
rabbit_db: Return error from `force_boot_command_test/0` with Khepri 2024-12-02 13:33:08 +01:00
Jean-Sébastien Pédron 7bc7808090
Merge pull request #12868 from rabbitmq/fix-typo-in-cli-message
rabbitmq_cli: Fix typo in an error message in `join_cluster`
2024-12-02 13:13:49 +01:00
Jean-Sébastien Pédron 58c609c4e7
rabbitmq_cli: Fix typo in an error message in `join_cluster` 2024-12-02 11:51:24 +01:00
Jean-Sébastien Pédron ae4f37b949
Merge pull request #12858 from rabbitmq/consul-do-not-set-bind_addr-in-test-config
rabbitmq_peer_discovery_consul: Set `bind_addr` to 127.0.0.1 in test config
2024-12-02 11:38:10 +01:00
Jean-Sébastien Pédron b03f0bd07d
rabbitmq_peer_discovery_consul: Log output from Consul daemon
[Why]
It helps diagnose any startup issues. Typically a problem with the
configuration where the log file is not yet created.
2024-12-02 11:14:26 +01:00
Jean-Sébastien Pédron f4d61d2775
rabbitmq_peer_discovery_consul: Configure Consul test instance log file 2024-12-02 11:14:26 +01:00
Jean-Sébastien Pédron 6941e10a28
rabbitmq_peer_discovery_consul: Set `bind_addr` to 127.0.0.1 in test config
[Why]
The test configuration was querying a network interface IP address based
on its name. However, the name, "eth0", is very specific to Linux. This
broke the test on other systems.

[How]
We still have to set an explicit `bind_addr` because Consul refuses to
start if the host has multiple private IPv4 addresses, as it is the case
in CI.

Therefore, we hard-code 127.0.0.1 as the IPv4 address to use because it has a
great chance to exist about anywhere.
2024-12-02 11:14:14 +01:00
Jean-Sébastien Pédron 9f3c8de164
Merge pull request #12860 from rabbitmq/fix-node-start-in-cli-tests
Fix node start in cli tests
2024-11-29 18:14:40 +01:00
Jean-Sébastien Pédron cead668b72
Merge pull request #12859 from rabbitmq/set-partitions-in-khepri-cli_cluster_status
rabbit_khepri: Report no partitions from `cli_cluster_status/0`
2024-11-29 18:14:03 +01:00
Jean-Sébastien Pédron 0411864670
rabbitmq_cli: Honor $RABBITMQ_METADATA_STORE when starting test node
[Why]
Two reasons:
1. We need to set the correct feature flags on the test node we have to
   start.
2. We can skip Mnesia- or Khepri-specific tests if they are marked.
2024-11-29 17:01:05 +01:00
Jean-Sébastien Pédron e480513297
rabbitmq_cli: Use `make start-background-broker` to start test node
[Why]
The `run-background-broker` does not wait for the node to be ready,
leading to some transient errors in the testsuite.

[How]
The `start-background-broker` does wait.

While here, export the value of `$(MAKE)`. Otherwise, nested uses of
make(1) may use the wrong make command.
2024-11-29 16:57:59 +01:00
Jean-Sébastien Pédron df9882417c
rabbit_khepri: Report no partitions from `cli_cluster_status/0` 2024-11-29 16:53:55 +01:00
Jean-Sébastien Pédron 84607b7d2f
Merge pull request #12853 from rabbitmq/mirrored-sup-retry-update-after-db-timeout
mirrored_supervisor: Catch timeout from Khepri in `hanlde_info/2`
2024-11-29 12:35:44 +01:00
Jean-Sébastien Pédron 4621fe7730
mirrored_supervisor: Catch timeout from Khepri in `hanlde_info/2`
[Why]
The code assumed that the transaction would always succeed. It was kind
of the case with Mnesia because it would throw an exception if it
failed.

Khepri returns an error instead. The code has to handle it. In
particular, we see timeouts in CI and before this patch, they caused a
crash because the list comprehension was asked to work on a tuple.

[How]
We now retry a few times for 10 seconds.
2024-11-29 12:03:59 +01:00
Jean-Sébastien Pédron 913bd9fa42
rabbit_db: Fix `rabbit_db_msup:update_all/2` spec
[Why]
It can return an error.
2024-11-29 12:03:35 +01:00
Jean-Sébastien Pédron 84449a4a39
Merge pull request #12846 from rabbitmq/bump-horus
Pin Horus to 0.3.1 temporarily
2024-11-29 11:01:33 +01:00
Jean-Sébastien Pédron ae9fbb7bd5
Pin Horus to 0.3.1 temporarily
[Why]
We pin a version of Horus even if we don't use it directly (it is a
dependency of Khepri). But currently, we can't update Khepri while still
needing the fix in Horus 0.3.1.

Horus 0.3.1 works around a crash in `cover` that mostly affects CI for
now.

This pinning will have to go away with the next update of Khepri.
2024-11-29 09:50:08 +01:00
Michael Klishin 534e4f1801
Merge pull request #12851 from rabbitmq/mk-oauth2-type-spec-improvements
Type spec improvements in rabbit_auth_backend_oauth2
2024-11-28 16:54:44 -05:00
Michael Klishin 719b5564c9
Cosmetics 2024-11-28 15:55:13 -05:00