Commit Graph

19 Commits

Author SHA1 Message Date
Aitor Perez 07adc3e571
Remove Bazel files 2025-03-13 13:42:34 +00:00
Jean-Sébastien Pédron e72d911080
rabbit_peer_discovery: Compute start time once
... and cache it.

[Why]
It happens at least in CI that the computed start time varies by a few
seconds. I think this comes from the Erlang time offset which might be
adjusted over time.

This affects peer discovery's sorting of RabbitMQ nodes which uses that
start time to determine the oldest node. When the start time of a node
changes, it could be considered the seed node to join by some nodes but
ignored by the other nodes, leading to troubles with cluster formation.
2025-03-12 09:36:17 +01:00
Michael Klishin 968eefa1bb
Bump (c) line year
There are no functional changes to this massive diff.
2025-01-01 17:54:10 -05:00
Loïc Hoguin 5086553bdd
make: Correct rabbitmq_prelaunch/rabbitmq_stream_common deps 2024-09-30 12:35:42 +02:00
Loïc Hoguin a17fb13a03
make: Initial work on using ct_master to run tests
Because `ct_master` is yet another Erlang node, and it is used
to run multiple CT nodes, meaning it is in a cluster of CT
nodes, the tests that change the net_ticktime could not
work properly anymore. This is because net_ticktime must
be the same value across the cluster.

The same value had to be set for all tests in order to solve
this. This is why it was changed to 5s across the board. The
lower net_ticktime was used in most places to speed up tests
that must deal with cluster failures, so that value is good
enough for these cases.

One test in amqp_client was using the net_ticktime to test
the behavior of the direct connection timeout with varying
net_ticktime configurations. The test now mocks the
`net_kernel:get_net_ticktime()` function to achieve the
same result.
2024-08-29 15:23:31 +02:00
Michael Klishin 40903581ef Bump version to 4.0 in a few places 2024-07-19 01:21:30 -04:00
Loïc Hoguin bbfa066d79
Cleanup .gitignore files for the monorepo
We don't need to duplicate so many patterns in so many
files since we have a monorepo (and want to keep it).

If I managed to miss something or remove something that
should stay, please put it back. Note that monorepo-wide
patterns should go in the top-level .gitignore file.
Other .gitignore files are for application or folder-
specific patterns.
2024-06-28 12:00:52 +02:00
Loïc Hoguin 9f15e978b1
make: Remove xrefr
It is no longer used by Erlang.mk.
2024-06-25 13:08:08 +02:00
Michal Kuratczyk cfa3de4b2b
Remove unused imports (thanks elp!) 2024-05-23 16:36:08 +02:00
Rin Kuryloski 01ff713830 Update PLT_APPS for rabbitmq_prelaunch 2024-04-29 15:01:35 +02:00
Rin Kuryloski 6d845c570c Add dep_gen_batch_server to rabbitmq-components.mk
Follow up to #11016
2024-04-16 17:39:21 +02:00
Michael Klishin f414c2d512
More missed license header updates #9969 2024-02-05 11:53:50 -05:00
Michael Klishin 7b151a7651 More missed (c) header updates 2024-01-22 23:44:47 -05:00
Jean-Sébastien Pédron 9a02e3e6ef
rabbit_logger_std_h: Mock calls to io:put_chars/2 during testing
[Why]
Before `rabbitmq_prelaunch` was moved from `deps/rabbit/apps` to `deps`,
it would inherit compile flags from `deps/rabbit`. Therefore, when
`rabbit` was tested, `rabbit_logger_std_h` simply replaced the calls to
`io:put_chars/2` with an internal macro to also call `ct:log/2`.

This is not possible anymore after the move and the move broke the
console-based testcases.

[How]
`rabbit_logger_std_h` now uses an indirect internal call to a wrapper of
`io:put_chars/2`. This allows the `logging_SUITE` to mock that call and
add the addition call to `ct:log/2`.

We need to do an explicit `?MODULE:io_put_chars/2` even though a local
call would work, otherwise meck can't intercept the calls.
2024-01-18 13:58:40 +01:00
Jean-Sébastien Pédron 89c6c590bd
rabbit_logger_std_h: Sync with Erlang/OTP 26.1.2
[Why]
`rabbit_logger_std_h` is a fork of Erlang/OTP's `logger_std_h` to:
* allow to mock the call to io:put_chars/2
* support date-based rotation

[How]
The initial fork was from Erlang/OTP 23.0. Here, we update it to
Erlang/OTP 26.1.2.
2024-01-18 13:58:40 +01:00
Jean-Sébastien Pédron 67fccf0ccc
rabbit_prelaunch_early_logging: Always export APIs needed in tests
[Why]
Before `rabbitmq_prelaunch` was moved from `deps/rabbit/apps` to `deps`,
it would inherit compile flags from `deps/rabbit`. Therefore, when
`rabbit` was tested, `rabbitmq_prelaunch` would be compiled with
`-DTEST`.

After the move, this is not the case anymore. Thus, the `logging_SUITE`
testsuite can't call those internal functions anymore.

[How]
Now, the needed functions are always exported. We simply comment that
they are for internal testing purpose and should not be called in
production code.
2024-01-18 13:58:40 +01:00
Luke Bakken d5aaaa95ea
Ensure `peer:start/1` takes long names into account
Discovered while testing
https://github.com/rabbitmq/rabbitmq-server/pull/10108 by using the
lukebakken/docker-rabbitmq-cluster project.

That project, by default, uses longnames for node names. When testing
classic peer discovery, starting a peer node would time out every time.

Ensure `host` is set
2023-12-14 06:12:52 -08:00
Jean-Sébastien Pédron cc18c8b141
rabbitmq_prelaunch: Adapt Makefiles and Bazel files after the move 2023-12-08 14:42:53 +01:00
Jean-Sébastien Pédron 26ebcda301
Move rabbitmq_prelaunch from `deps/rabbit/apps` to `deps`
[Why]
Building an Erlang release with this application under `apps` happened
to be problematic with Erlang.mk. Our use of deps and apps is not
exactly standard here anyway.

We also get issues with various make targets where `rabbitmq_prelaunch`
is being cleaned and not re-compiled, leading to "application not found"
errors.

[How]
So instead of fighting, move `rabbitmq_prelaunch` to the deps directory,
like all other applications.

This commit is not enough and will be followed with changes to Makefiles
and Bazel files. This is not done in this commit so the changes are
visible. Otherwise, they would be burried in the move.
2023-12-08 12:52:56 +01:00