Commit Graph

1921 Commits

Author SHA1 Message Date
Michael Klishin e8cb671633
Bump credentials_obfuscation version 2020-12-21 03:42:42 +03:00
Arnaud Cogoluègnes 41160210ab
Start stream consumer REST endpoint 2020-12-01 18:23:22 +01:00
Arnaud Cogoluègnes 23d7e8114c
Introduce stream management plugin 2020-11-19 14:48:25 +01:00
Jean-Sébastien Pédron 778e8dad5c
rabbit_common: Remove the rabbitmq-github-actions Erlang.mk plugin
This is unused after the switch to the "monorepository".
2020-11-17 15:29:05 +01:00
Jean-Sébastien Pédron 47686ee1f0
Remove unused .github directories
They were valid until the switch to the "monorepository" when everything
was merged into a single Git repository.
2020-11-17 13:33:16 +01:00
Arnaud Cogoluègnes 722dda6eaf Update rabbitmq-components.mk to include stream plugin 2020-11-03 14:26:45 +01:00
Luke Bakken fd73767051 Revert "Handle potential undefined value returned from process dictionary"
This reverts commit 04627ef2ef.
2020-11-02 10:02:46 -08:00
Michael Klishin e6972966bb Part of rabbitmq/rabbitmq-auth-mechanism-ssl#12 2020-10-30 18:46:09 +03:00
Michael Klishin 0284c222e5 Merge branch 'master' into update-cowboy-dep 2020-10-21 09:44:22 +03:00
Michael Klishin 4dfffd312f Remove a (now) unused delegate 2020-10-20 21:14:42 +03:00
Luke Bakken f0c1d17e3a Remove code to guess thread pool size
Part of rabbitmq/rabbitmq-server#2473
2020-10-20 10:23:54 -07:00
Loïc Hoguin 44be0b1114 Update Cowboy to 2.8.0
This will enable stacktraces in the logs again.
2020-10-20 17:07:45 +02:00
Luke Bakken 04627ef2ef Handle potential undefined value returned from process dictionary
CI failures such as this suggest that file handle values can be deleted
mid-operation:

https://github.com/rabbitmq/rabbitmq-server/actions/runs/304216635
2020-10-15 05:49:16 -07:00
Michael Klishin 45158f49ac Merge pull request #409 from rabbitmq/auth-attempt-metrics
Add auth attempt metrics
2020-10-14 23:56:02 +03:00
Jean-Sébastien Pédron 6d1c7dc6d7 Travis CI: Test against Erlang 22.3+23.0 and Elixir 1.10 2020-10-13 11:39:43 +02:00
Jean-Sébastien Pédron b9defc1bff rabbit_env: Fix parsing of $CONF_ENV_FILE output
The `set` command in the implementation of `/bin/sh` included in the
official RabbitMQ Docker image returns multi-line variable values
differently than the tested Bourne shell implementation (GNU Bash, dash
and FreeBSD sh).

I don't know what implementation is used by that Docker image, but here
is the output of `set`, for a variable set to "\n'test'":

    TEST_VAR='
    '"'"'test'"'"

The problem was reported in the following discussion:
https://github.com/rabbitmq/rabbitmq-server/discussions/2458

While here, add a small testcase to check a couple outputs.
2020-10-07 15:33:49 +02:00
kjnilsson db59327963 Move rabbit_mics:confirm_to_sender/3 to server
As it is only used by the server and does not need to be a shared
function.
2020-10-07 13:05:07 +01:00
Nicolas Caille 6f3681210e remove TLSv1.3 from BAD_SSL_PROTOCOL_VERSIONS 2020-10-06 21:27:53 +02:00
Jean-Sébastien Pédron 3a65b3c624 rabbitmq-github-actions.mk: Use Elixir 1.10.4
This is the minimum requirement now, because that's the oldest version
we test against.
2020-10-05 15:46:07 +02:00
Jean-Sébastien Pédron 8bd3bede55 rabbitmq-github-actions.mk: Test with Erlang 23.1
... instead of 23.0.

Erlang 23.1 is the version the Concourse pipelines use. We expect the
Concourse pipelines and the GitHub Actions workflow to be on the same
page.
2020-10-05 15:44:49 +02:00
Jean-Sébastien Pédron e5127eaea3 rabbit_log: Restore alphabetical order in the defintion of category() 2020-10-05 14:21:52 +02:00
kjnilsson e0a210cc67 Dialyzer fixes 2020-10-02 10:22:10 +01:00
kjnilsson b87898185b Take stream queue dir into account
For rabbit_env suite.
2020-09-30 14:41:59 +01:00
Arnaud Cogoluègnes 749faa85fa Add stream plugin port in start-cluster target 2020-09-30 14:41:59 +01:00
kjnilsson 28b6b812b1 Add osiris logger sink 2020-09-30 14:41:59 +01:00
kjnilsson bbd0cc8198 Add osiris logging shim 2020-09-30 14:41:59 +01:00
kjnilsson f7dcd081fa change return message format 2020-09-30 14:41:59 +01:00
dcorbacho 0cec212896 Stream queue data dir 2020-09-30 14:41:59 +01:00
Michael Klishin 5a215e0f03 Merge branch 'master' into lrb-update-supervisor 2020-09-30 11:22:15 +03:00
Michael Klishin 8f7ecf363f Migrate a supervisor2 suite by @lukebakken from rabbitmq-server
References rabbitmq/rabbitmq-server#2457.
2020-09-30 11:00:32 +03:00
Luke Bakken 39ec461331 Fix transient type handling 2020-09-29 13:49:34 -07:00
Luke Bakken a0bd637558 Fix function ordering to restart correctly. Reduce log spam. 2020-09-29 11:52:35 -07:00
Luke Bakken 6ed6573cef Update mix_task_archive_deps version
https://github.com/rabbitmq/mix_task_archive_deps/releases/tag/0.5.0

See this as well:

https://github.com/rabbitmq/mix_task_archive_deps/pull/2

https://groups.google.com/d/topic/rabbitmq-users/0d8TBs_qmGE/discussion
2020-09-28 15:36:02 -07:00
Michael Klishin 2c14e1dd3f Merge branch 'master' into lrb-update-supervisor 2020-09-26 10:00:57 +03:00
Michael Klishin 160742ea8a rpc module calls can return a {badrpc, term()} 2020-09-24 23:15:32 +03:00
dcorbacho 9c56b0cffc Add get_auth_attempts_by_source api 2020-09-23 15:52:50 +01:00
Luke Bakken c1d59f600c Remove tabs 2020-09-22 12:13:44 -07:00
Luke Bakken 111124bc05 Several bug fixes found when running tests
Validate delay value
2020-09-22 12:08:32 -07:00
dcorbacho 8bb1fbdf3d Merge remote-tracking branch 'origin/master' into auth-attempt-metrics 2020-09-22 17:11:08 +01:00
dcorbacho 0d09fb0a85 Split auth attempt metrics into global and detailed
GC collection can then be done by deleting all entries on the ETS table
and total counters per protocol can be kept without individually scanning
all entries
2020-09-22 16:47:10 +01:00
dcorbacho 4c6251d3fb Include protocol in auth metrics 2020-09-22 16:46:52 +01:00
Luke Bakken db7dfdf0cf Remove old supervisor2 module 2020-09-21 15:15:11 -07:00
Luke Bakken 0a87aeace5 Begin migration of code from supervisor2 to the 22.3.4.10 version
Moved a lot of code from old supervisor to new one

All compilation errors fixed

Use the macro, Luke
2020-09-21 15:14:49 -07:00
Philip Kuryloski c1a4790c7b Erlang 21.3 -> 22.3 for `make github-actions`
This has no direct effect until GitHub Actions workflows are
regenerated using make
2020-09-02 10:21:20 +02:00
Luke Bakken 4c9d67bb9d Do not change the behavior of rpc_call 2020-09-02 03:42:58 +03:00
Luke Bakken bf199aa36c Set RPC_TIMEOUT to 15 seconds 2020-09-02 03:42:58 +03:00
Luke Bakken 3f1c26d951 Add function to allow setting timeout on multicall
A timeout will be handled as an empty result.

@michaelklishin - should that be logged?
2020-09-02 03:42:58 +03:00
dcorbacho 4ad6396475 Add auth attempt metrics 2020-08-28 13:21:13 +01:00
Michael Klishin 8f2df3bad0 Bump credentials_obfuscation to 2.2.0 2020-08-20 14:27:01 +03:00
Jean-Sébastien Pédron 94de4c07ba rabbit_nodes_common: Disable Dialyzer warning for diagnostics_node/1
net_adm:name/1 returns a new value, 'noport', in Erlang 24. This value
being absent in the function spec in previous versions of Erlang, we get
a warning from Dialyzer until we start to the yet-to-be-release Erlang
24 in CI. Therefore we disable this specific warning.
2020-08-20 14:27:01 +03:00
Jean-Sébastien Pédron 2f779e8668 rabbit_nodes_common: Handle `noport` return value from net_adm:names/1
This is a new return value in Erlang 24 when the hostname passed to
net_adm:names/1 couldn't be resolved.
2020-08-20 14:27:01 +03:00
Jean-Sébastien Pédron 32be18d42a rabbitmq-dist.mk: Exclude `ebin/dep_built` from plugin packaging
This is a state file for Erlang.mk only.
2020-08-20 14:27:01 +03:00
Jean-Sébastien Pédron f59db9f8a6 rabbitmq-dist.mk: Package plugins as directories by default
... instead of .ez archives.

The benefits for doing this:

* We can use native code, as is the case for lz4 and zstd bindings in
  the Tanzu RabbitMQ version for instance. Indeed, Erlang does not
  support loading native code (NIF or port drivers) from .ez archives.

* We can remove custom code to handle .ez archives. We have special
  cases in Erlang.mk plugins as well as the `rabbit_plugins` module, in
  particular the code to extract .ez archives (even though Erlang knows
  how to use them directly).

* Prevent hard to debug situations when the .ez archive name does not
  match the top-level directory inside the archive. In this case, Erlang
  says it can't load the application but doesn't tell much more.

* Debugging and "hot-patching" plugins become easier: we just have to
  copy the recompiled .beam file in place of the existing one. There
  is no need to unpack the plugin, replace the file and recreate the
  archive.

* Release packages can be smaller. gzip, bzip2 and xz, common
  compression algorithm for Unix packages, give much better result if
  they compress the .beam files directly instead of "compressing" zip
  files (the .ez archives are plain zip archives). For instance, the
  generic-unix package goes from 15 MiB when using .ez archives to just
  12 MiB when using directory.

I would also like to experiment with Erlang releases in the future.
Using directories for Erlang applications instead of .ez archives is
mandatory for this to work according to my latest tests.

Of course, this change doesn't break support for .ez archives (and we
will keep support for this). End users can still download third-party
plugins as .ez archives and drop them in the plugins directory.
2020-08-20 14:27:01 +03:00
Luke Bakken d9b352a8ff Avoid using os:find_executable to find erl
On Windows, the current working directory is also searched, which can
lead to problems. Instead, use `init:get_argument(root)` to get the root
of the Erlang release, then we know `bin/erl` will always be present.
2020-08-20 14:27:01 +03:00
Luke Bakken 866b810d0e rabbitmq-components.mk: Improve top-level DEPS_DIR detection for rabbit_prelaunch 2020-08-20 14:27:00 +03:00
Jean-Sébastien Pédron efda8c587e rabbitmq-components.mk: Improve top-level DEPS_DIR detection
In addition to the `rabbitmq-components.mk` existence check, we now
verfy that the directory is named `deps`.

This is to increase the chance that, if we find a
`rabbitmq-componentS.mk` file in the upper directories, this project is
indeed inside a DEPS_DIR.

For instance, in our GitHub Actions workflows, when we prepared the
secondary umbrellas for mixed-version testing, it happened that the
secondary umbrellas were under a clone of rabbitmq-server. Therefore
the first (and only) condition was met and the Makefile erroneously
considered it was inside a DEPS_DIR. As a consequence, dependencies of
the umbrellas were fetched in the wrong place.
2020-08-20 14:27:00 +03:00
Luke Bakken 700fbd7873 Update method to determine dependency directories
This new method by @dumbbell will work with any sub-component, not just the umbrella
2020-08-20 14:27:00 +03:00
Michael Klishin 2aa5d04a9f Bump credentials_obfuscation to 2.1.1 2020-08-20 14:27:00 +03:00
Jean-Sébastien Pédron 9bec817372 GitHub Actions: Default to Erlang 21.3 and 23.0 2020-08-20 14:27:00 +03:00
dcorbacho cbd99c9b4c Update erlang.mk 2020-08-20 14:27:00 +03:00
Michael Klishin bd6c8932a9 Bump stdout_formatter to 0.2.4 2020-08-20 14:27:00 +03:00
Michael Klishin 839f7ca7d1 Bump sysmon_handler to 1.3.0 2020-08-20 14:26:59 +03:00
Michael Klishin 362f0edc06 Bump JSX to 2.11.0 2020-08-20 14:26:59 +03:00
dcorbacho 09c2760bb4 Revert drop of Exhibit B on MPL 2.0 2020-08-20 14:26:59 +03:00
Michael Klishin 4deee618ab Bump credentials_obfuscation to 2.2.0 2020-08-14 08:02:13 +03:00
Jean-Sébastien Pédron d82cf55e3e rabbit_nodes_common: Disable Dialyzer warning for diagnostics_node/1
net_adm:name/1 returns a new value, 'noport', in Erlang 24. This value
being absent in the function spec in previous versions of Erlang, we get
a warning from Dialyzer until we start to the yet-to-be-release Erlang
24 in CI. Therefore we disable this specific warning.
2020-08-13 15:02:51 +02:00
Jean-Sébastien Pédron 9c2f7ee01f rabbit_nodes_common: Handle `noport` return value from net_adm:names/1
This is a new return value in Erlang 24 when the hostname passed to
net_adm:names/1 couldn't be resolved.
2020-08-13 14:36:04 +02:00
Jean-Sébastien Pédron ebd88bc7e8 rabbitmq-dist.mk: Exclude `ebin/dep_built` from plugin packaging
This is a state file for Erlang.mk only.
2020-08-11 16:19:19 +02:00
Michael Klishin 406fe48fce Merge branch 'master' into lrb-find-erl-safely 2020-08-09 04:12:43 +03:00
Jean-Sébastien Pédron 9d62a6df30 rabbitmq-dist.mk: Package plugins as directories by default
... instead of .ez archives.

The benefits for doing this:

* We can use native code, as is the case for lz4 and zstd bindings in
  the Tanzu RabbitMQ version for instance. Indeed, Erlang does not
  support loading native code (NIF or port drivers) from .ez archives.

* We can remove custom code to handle .ez archives. We have special
  cases in Erlang.mk plugins as well as the `rabbit_plugins` module, in
  particular the code to extract .ez archives (even though Erlang knows
  how to use them directly).

* Prevent hard to debug situations when the .ez archive name does not
  match the top-level directory inside the archive. In this case, Erlang
  says it can't load the application but doesn't tell much more.

* Debugging and "hot-patching" plugins become easier: we just have to
  copy the recompiled .beam file in place of the existing one. There
  is no need to unpack the plugin, replace the file and recreate the
  archive.

* Release packages can be smaller. gzip, bzip2 and xz, common
  compression algorithm for Unix packages, give much better result if
  they compress the .beam files directly instead of "compressing" zip
  files (the .ez archives are plain zip archives). For instance, the
  generic-unix package goes from 15 MiB when using .ez archives to just
  12 MiB when using directory.

I would also like to experiment with Erlang releases in the future.
Using directories for Erlang applications instead of .ez archives is
mandatory for this to work according to my latest tests.

Of course, this change doesn't break support for .ez archives (and we
will keep support for this). End users can still download third-party
plugins as .ez archives and drop them in the plugins directory.
2020-08-07 17:22:47 +02:00
Luke Bakken b499da835e Avoid using os:find_executable to find erl
On Windows, the current working directory is also searched, which can
lead to problems. Instead, use `init:get_argument(root)` to get the root
of the Erlang release, then we know `bin/erl` will always be present.
2020-08-07 08:06:43 -07:00
Luke Bakken a127b7fada rabbitmq-components.mk: Improve top-level DEPS_DIR detection for rabbit_prelaunch 2020-08-04 08:55:08 -07:00
Jean-Sébastien Pédron 4934e2b01e rabbitmq-components.mk: Improve top-level DEPS_DIR detection
In addition to the `rabbitmq-components.mk` existence check, we now
verfy that the directory is named `deps`.

This is to increase the chance that, if we find a
`rabbitmq-componentS.mk` file in the upper directories, this project is
indeed inside a DEPS_DIR.

For instance, in our GitHub Actions workflows, when we prepared the
secondary umbrellas for mixed-version testing, it happened that the
secondary umbrellas were under a clone of rabbitmq-server. Therefore
the first (and only) condition was met and the Makefile erroneously
considered it was inside a DEPS_DIR. As a consequence, dependencies of
the umbrellas were fetched in the wrong place.
2020-07-30 12:01:44 +02:00
Luke Bakken 8f4f0c9618 Update method to determine dependency directories
This new method by @dumbbell will work with any sub-component, not just the umbrella
2020-07-29 10:01:42 -07:00
Michael Klishin 2473d9e62c Bump credentials_obfuscation to 2.1.1 2020-07-29 04:42:02 +03:00
Jean-Sébastien Pédron 782bead4c0 GitHub Actions: Default to Erlang 21.3 and 23.0 2020-07-24 16:03:04 +02:00
dcorbacho f9228fb071 Update erlang.mk 2020-07-21 14:31:38 +01:00
Michael Klishin 1b89b2203d Bump stdout_formatter to 0.2.4 2020-07-21 13:12:36 +03:00
Michael Klishin a27969c2f2 Bump sysmon_handler to 1.3.0 2020-07-21 03:42:37 +03:00
Michael Klishin 3e668819e3 Bump JSX to 2.11.0 2020-07-21 03:42:37 +03:00
dcorbacho 749e5c9ee1 Revert drop of Exhibit B on MPL 2.0 2020-07-20 16:55:58 +01:00
Anupama Singh 9495a5f8cb user_limits feature flag implementation 2020-07-17 15:55:47 +01:00
Ayanda-D acb586e0a9 Per-user connection and channel tracking records, definitions, types 2020-07-17 15:55:47 +01:00
Anupama Singh 3ce3b9d995 New field limits in #internal_user to store the user limits 2020-07-17 15:54:18 +01:00
Michael Klishin 8780e4eee0 Update MPL2 license file, drop Exhibit B
and add a VMware copyright notice.

We did not mean to make this code Incompatible with Secondary Licenses
as defined in [1].

1. https://www.mozilla.org/en-US/MPL/2.0/FAQ/
2020-07-17 14:53:09 +03:00
Michael Klishin d1f27b08b8 Drive by change: squash a compiler warning 2020-07-14 03:50:09 +03:00
Michael Klishin 2b80223ed6 Initial API bits for marking a node as being drained (or not)
Part of #2321.
2020-07-14 03:50:09 +03:00
Michael Klishin 58dc58d846 Introduce node maintenance state record 2020-07-14 03:50:08 +03:00
Michael Klishin 62c08ca4c6 Merge branch 'master' into switch-to-MPL-2.0 2020-07-10 13:01:20 +03:00
Jean-Sébastien Pédron 368586ec1b Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-07 18:06:39 +02:00
Jean-Sébastien Pédron 33acee94cc rabbit_env: Give precedence to $RABBITMQ_* prefixed variables in the output of $CONF_ENV_FILE
When we source the $CONF_ENV_FILE script, we set a few variables which
this script expects. Those variables are given without their prefix. For
instance, $MNESIA_BASE.

The $CONF_ENV_FILE script can set $RABBITMQ_MNESIA_BASE. Unfortunately
before this patch, the variable would be ignored, in favor of the
default value which was passed to the script ($MNESIA_BASE).

The reason is that variables set by the script are handled in the
alphabetical order. Thus $MNESIA_BASE is handled first, then
$RABBITMQ_MNESIA_BASE.

Because the code didn't give any precedence, the first variable set
would "win". This explains why users who set $RABBITMQ_MNESIA_BASE in
$CONF_ENV_FILE, but using RabbitMQ 3.8.4+ (which introduced
`rabbit_env`), unexpectedly had their node use the default Mnesia base
directory.

The patch is rather simple: when we check if a variable is already set,
we give precedence to the $RABBITMQ_* prefixed variables. Therefore, if
the $CONF_ENV_FILE script sets $RABBITMQ_MNESIA_BASE, this value will be
used, regardless of the value of $MNESIA_BASE.

This didn't happen with variables set in the environment (i.e. the
environment of rabbitmq-server(8)) because the prefixed variables
already had precedence.

Fixes rabbitmq/rabbitmq-common#401.
2020-07-07 16:28:18 +02:00
Jean-Sébastien Pédron 9ab7942d83 rabbit_log: Add Logger handler's log/2 API
This allows RabbitMQ to configure `rabbit_log` as a Logger handler.

See a related commit in rabbit_prelaunch_early_logging in
rabbitmq-server, where `rabbit_log` is being configured as a Logger
handler. The commit message explains the reason behind this.
2020-07-06 14:18:05 +02:00
Jean-Sébastien Pédron 878c5e23cd Update erlang.mk 2020-06-23 17:12:59 +02:00
Jean-Sébastien Pédron 061f306ced GitHub Actions: Fix mentions of "rabbitmq-cli" 2020-06-10 17:47:33 +02:00
Jean-Sébastien Pédron 78585ad70a GitHub Actions: Trigger rabbitmq-server workflows after a commit
... to this repository's `master` branch.

The idea is to make sure rabbitmq-server is tested against this new
version of rabbitmq-common.
2020-06-10 16:35:15 +02:00
Michael Klishin a5923705f7 Bump Recon to 2.5.1
for Erlang 23 compatibility of 'rabbitmq-diagnostics observer'

References zhongwencool/observer_cli#68.
2020-06-09 08:22:15 +03:00
Michael Klishin 0e577ee358 Merge branch 'master' into rabbitmq-cli-424 2020-06-05 17:22:08 +03:00
Michael Klishin 5a74a54dd4 Introduce a way to list available NICs in a more presentable format
Part of rabbitmq/rabbitmq-cli#424
2020-06-05 17:21:39 +03:00
Jean-Sébastien Pédron 76a789fbac rabbit_env_SUITE: Prevent load of `$CONF_ENV_FILE` for the entire testsuite
It avoids any pollution from the environment.
2020-06-05 11:43:22 +02:00
Jean-Sébastien Pédron 1ca5c3e72e rabbit_env_SUITE: Test context_to_code_path() for Windows as well 2020-06-05 11:43:14 +02:00
Jean-Sébastien Pédron 474ab2204c rabbit_env: Use the context's OS type in get_user_lib_dirs() 2020-06-05 10:21:06 +02:00
Jean-Sébastien Pédron b002ad6eed rabbit_env: Organize Unix' do_load_conf_env_file as the Window version 2020-06-05 10:21:06 +02:00
Luke Bakken d6a16caa9b rabbit_env: Add support for RABBITMQ_CONF_ENV_FILE on Windows
Fixes #392

Fixes from ERL-1269

match the map

deal with line endings
2020-06-05 10:21:00 +02:00
Michael Klishin 9f6087acc6 Message store settings we already have use the "msg_store" prefix 2020-06-03 20:36:17 +03:00
Philip Kuryloski c40c2628a9 Add a specific shutdown timeout macro and property for message stores
The default timeout of 30 seconds was not sufficient to allow graceful shutdown of a message store with millions of persistent messages. Rather than increase the timeout in general, introduce a new macro with a default of 600 seconds
2020-06-02 14:37:13 +02:00
Michael Klishin c3db0a1beb Introduce rabbit_types:error/2
Part of #2356.
2020-05-30 04:41:29 +03:00
Jean-Sébastien Pédron e6f383dd94 GitHub Actions: Pass files between jobs using artefacts
... instead of the cache action.

The cache action is quite unstable (failing to download the cached
files). In this commit, we try to use the artefacts instead. At this
point, we don't know if it is more reliable, but we'll see with time.

As an added bonus, we can download the archives passed between jobs for
inspection if we need.
2020-05-25 10:18:16 +02:00
Michael Klishin e629102397 Update type specs in rabbit_pbe
In follow-up to rabbitmq/rabbitmq-server#2351, #389.
2020-05-22 16:05:35 +03:00
Luke Bakken fe6312f0ca Add function heads to rabbit_pbe to take credentials-obfuscation 2.0 into account 2020-05-20 19:04:28 -07:00
Luke Bakken 846ac6e957 Update to credentials_obfuscation 2.0
Part of the following:
https://github.com/rabbitmq/credentials-obfuscation/pull/5
2020-05-20 16:08:26 -07:00
Jean-Sébastien Pédron 8d5ddda02a rabbitmq-build.mk: Don't add rabbitmq_cli to compiler path in amqp_client
Otherwise, for instance, running Dialyzer in the Erlang client fails with the
following error if it was cloned directly (i.e. outside of the Umbrella):

dialyzer: Bad directory for -pa: .../amqp_client/deps/rabbitmq_cli/_build/dev/lib/rabbitmqctl/ebin
2020-05-20 17:37:12 +02:00
Jean-Sébastien Pédron 64975ffe47 Revert switch to sys:get_log/1
It  does not exist in Erlang 21.
2020-05-19 17:06:50 +02:00
Jean-Sébastien Pédron 148a40a095 Address deprecation of erlang:get_stacktrace/0 and sys:get_debug/3 2020-05-19 16:48:59 +02:00
Jean-Sébastien Pédron 228aaf5885 GitHub Actions: Run Dialyzer with the latest Erlang version 2020-05-11 12:59:50 +02:00
Jean-Sébastien Pédron fae348f0ed GitHub Actions: Recreate secondary umbrellas in case of cache failure
We don't want the job to fail just because GitHub Actions failed to
restore the cache of the secondary umbrellas. We can just recreate them.
2020-05-11 12:58:41 +02:00
Jean-Sébastien Pédron 681bd126e0 GitHub Actions: Improve caching of secondary umbrellas
The cache key is based on the list of umbrellas included and the version
of Erlang because we now run `make test-dist` in the relevant project.
2020-05-07 12:57:34 +02:00
Jean-Sébastien Pédron 29856aad84 rabbit_env: Add get_used_env_vars/0 to fetch variables used by rabbit_env
... and their value.

Both prefixed and non-prefixed variables are returned by this function.

While here, fix a conflict between $RABBITMQ_HOME and $HOME in
var_is_used/1: the latter shouldn't be considered as used.
2020-05-06 18:32:21 +02:00
Gerhard Lazu eb29dd4dd2 Trigger test workflows on new-commit-to-dep-release-branch events
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-05-01 13:00:45 +01:00
Jean-Sébastien Pédron 0d27b9ad20 GitHub Actions: Add mixed-version cluster testing
When we generate the workflows, we pick the latest tag of each release
branch. That list of tags is used to clone secondary umbrellas in the
workflows and run the testsuites against each of them.

When generating workflows for `master`, we take the latest tag of each
release branch.

When generating workflows for a release branch, we take the latest tag
of each older release branch, plus the first tag of the same release
branch.

Some examples:
* `master` is tested with 3.8.3 and 3.7.25
* `v3.8.x` is tested with 3.8.0 and 3.7.25
2020-04-30 17:12:34 +02:00
Jean-Sébastien Pédron a6297a6589 GitHub Actions: Move `make bats` to rabbitmq-server
This is specific to rabbitmq-server and won't work in any other
repository.
2020-04-30 17:12:09 +02:00
Jean-Sébastien Pédron d409fd268a GitHub Actions: Rename template chunks to leave room 2020-04-30 16:59:10 +02:00
Jean-Sébastien Pédron 287fdefd15 GitHub Actions: Remove '/' from workflow names 2020-04-30 16:59:10 +02:00
Jean-Sébastien Pédron 7987702cdb GitHub Actions: Pass FAIL_FAST=1 and SKIP_AS_ERROR=1 to `make ct`
With this variable passed, testing will stop at the first failure
(instead of trying all testcases) and a skipped testcase is considered a
failure.
2020-04-30 16:59:10 +02:00
Jean-Sébastien Pédron a442dc597c GitHub Actions: Set vim shiftwidth & expandtab in headers 2020-04-30 15:48:25 +02:00
Jean-Sébastien Pédron 876552c95e rabbitmq-plugin.mk: Fix copy-paste error 2020-04-30 12:35:24 +02:00
Jean-Sébastien Pédron a8a47a42e3 GitHub Actions: Upload rabbitmq-deps.mk to S3 only for `master` & release branches 2020-04-28 13:19:38 +02:00
Jean-Sébastien Pédron 8006d36c04 rabbitmq-github-actions.mk: Set `DO_COMMIT=yes` to automatically commit
... the generated workflows.
2020-04-28 13:16:37 +02:00
Jean-Sébastien Pédron cf7041421a rabbitmq-github-actions.mk: Use $(base_rmq_ref) from rabbitmq-components.mk
..in templates.
2020-04-28 13:16:17 +02:00
Jean-Sébastien Pédron 1f623b1c07 GitHub Actions: Replace a hard-coded "21.3" by $(ERLANG_VERSION) 2020-04-27 17:56:10 +02:00
Jean-Sébastien Pédron 3c6a4c1f15 GitHub Actions: Use GitHub Actions "run_id" when uploading rabbitmq-deps.mk to S3
We need a monotonically increasing number for the version used by the
Concourse S3 resource. A Git commit hash does not work because they do
not have this property.
2020-04-27 14:46:13 +02:00
Jean-Sébastien Pédron 2b1e0f4bfc GitHub Actions: Don't cache `ebin` for now
It messes with Erlang.mk when a workflow is restarted, leading to a
failure in `make xref`.
2020-04-27 14:45:59 +02:00
Jean-Sébastien Pédron 7bf6f736a3 rabbitmq-github-actions.mk: New Erlang.mk plugin to help manage GitHub Actions workflows
The main entry point is `make github-actions` which generates the
workflows.

Currently, it handles workflows to test the project with different
versions of Erlang.
2020-04-27 13:22:34 +02:00
Jean-Sébastien Pédron 2d4b898b23 rabbitmq-tools.mk: Add project name & commit hash as a comment in rabbitmq-deps.mk
The comment is on the first line of the `$(PROJECT)-rabbitmq-deps.mk`
file.
2020-04-27 12:52:54 +02:00
Michael Klishin a8017e8675 rabbit_event:notify/{2,3}: support map events 2020-04-25 21:48:47 +03:00
Jean-Sébastien Pédron 509a218013 rabbitmq-tools.mk: New `rabbitmq-deps.mk` target
It generates a file called `$(PROJECT)-rabbitmq-deps.mk` which has a
dependency definition line of the form expected by Erlang.mk, for each
RabbitMQ component the project depends on.

Therefore the line indicates:
* `git` as the fetch method
* the repository URL
* the Git commit hash the dependency is on

Here is an example for rabbitmq-server:

    dep_rabbit_common := git https://github.com/rabbitmq/rabbitmq-common.git d9ccd8d9cdd58310901f318fed676aff59be5afb
    dep_rabbitmq_cli := git https://github.com/rabbitmq/rabbitmq-cli.git f6eaae292d27da4ded92b7c1b51a8ddcfefa69c2
    dep_rabbitmq_codegen := git https://github.com/rabbitmq/rabbitmq-codegen.git 65da2e86bd65c6b6ecd48478ab092721696bc709
2020-04-22 11:57:38 +02:00
Jean-Sébastien Pédron 2e06989877 Update erlang.mk 2020-04-21 15:52:57 +02:00
Luke Bakken af7466c1c8 Use PLATFORM to determine hostname command 2020-04-20 07:50:57 -07:00
Luke Bakken 30dbad3214 Use "hostname -s" only on Darwin
Fixes #374
2020-04-17 12:31:08 -07:00
Jean-Sébastien Pédron f818953072 rabbitmq-dist.mk: Fix incorrect quoting in install-cli-scripts
The double-quoting was requited in the flock(1)/lockf(1) blocks because
of the use of `sh -c`. However it's incorrect in the `else` block.

Follow-up to commit 3f32a36e50.
2020-04-15 13:56:05 +02:00
Jean-Sébastien Pédron e3cd5fad8d rabbitmq-run.mk: Replace two CLI calls with fast equivalents
The CLI has a high startup time. To speed up the
`start-background-broker` and `stop-node` recipes, two CLI calls are
replaced by two more basic commands which achieve the same goal.
2020-04-14 14:20:04 +02:00
Jean-Sébastien Pédron 3f32a36e50 rabbitmq-dist.mk: Defer computation of `$rabbit_scripts_dir` to install-cli-scripts recipe
The problem with the previous approach was that the `$(wildcard ...)`
directives might be evaluated too early: `deps/rabbit` might not be
available yet.

Moving the computation to the body of the recipe fixes the problem
because dependencies are available at this point.
2020-04-14 14:18:07 +02:00
Jean-Sébastien Pédron b93b89187b rabbitmq-dist.mk: Fix `install-cli-scripts` when rabbit is top-level
In other words, if instead of cloning the Umbrella, one cloned
rabbitmq-server directly, the `install-cli-scripts` recipe would fail to
copy the scripts because it assumed `rabbit` was under `$(DEPS_DIR)`.

Now expected places are checked and an error is emitted if the recipe
can't find the right one.
2020-04-06 13:07:58 +02:00
Philip Kuryloski 7ef99b8e25 Avoid the dependency on rabbit_ct_helpers in worker_pool_SUITE
This breaks the cyclic dependency between rabbitmq_ct_helpers and
rabbit_common.
2020-03-25 10:33:06 +01:00
Michael Klishin 435e493491 Add rabbitmq_ct_helpers to test dependencies
Requried as of #368.
2020-03-25 01:15:49 +03:00
Philip Kuryloski 4c73437a33 Move over worker_pool_SUITE from rabbitmq-server
to consolidate worker pool tests in a single location
2020-03-23 15:26:31 +01:00
Philip Kuryloski 3c0617eef0 use is_process_alive for a cleaner test
according to Michael's suggestion
2020-03-23 15:26:31 +01:00
Philip Kuryloski 16151baba3 Add worker_pool:dispatch_sync funtion
dispatch_sync sits inbetween the behavior of submit and submit_async,
blocking the caller until a worker begins the task, as opposed
to not blocking at all, or blocking util the task has finished.
This is useful when you want to throttle submissions to the pool
from a single process, such that all workers are busy, but there
exists no backlog of work for the pool.
2020-03-20 15:22:19 +01:00
Jean-Sébastien Pédron c6b0d1a767 rabbitmq-run.mk: Remove uses of $RABBITMQ_SCHEMA_DIR
This is unused by RabbitMQ after the completion of
rabbitmq/rabbitmq-server#2180.
2020-03-19 10:36:39 +01:00
Gerhard Lazu c96f6153b3 Default TAR to tar, use gtar on FreeBSD & Darwin
On Darwin, the default tar fails with unkown --transform flag.

FAILS:          bsdtar 2.8.3 - libarchive 2.8.3
SUCCEEDS:       tar (GNU tar) 1.32

re https://github.com/rabbitmq/rabbitmq-common/pull/364

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-18 15:19:49 +01:00
Jean-Sébastien Pédron 95013577ce rabbitmq-tools.mk: Exclude nodes' `mnesia` directory form archive
Those directories can be large and don't carry much value in the context
of the common_test logs.

While here, rename the target to `ct-logs-archive`.
2020-03-18 13:59:50 +01:00