Commit Graph

1921 Commits

Author SHA1 Message Date
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
Jean-Sébastien Pédron a070290864 rabbitmq-tools.mk: Add compress-ct-logs target
If there are common_test logs (i.e. `logs` exists), it creates an archive
(compressed with xz(1)) in the top-level directory.

The archive is named `$(PROJECT)-ct-logs-$timestamp.tar.xz` by default.
The name can be changed by setting `$(CT_LOGS_ARCHIVE)`. The file
extension must be `.tar.xz`.
2020-03-17 19:30:48 +01:00
Jean-Sébastien Pédron bb3f355b37 rabbitmq-run.mk: Build RabbitMQ once when using start-{brokers,cluster}
... instead of once per started nodes.
2020-03-17 18:42:12 +01:00
Jean-Sébastien Pédron 13bbfa0dfd rabbitmq-run.mk: Use := instead of ?= in target-specific var. assignment
The documentation says we should be able to use ?=, but apparently it
affects the way variables are passed to sub-make.

The issue we had is that using: `make start-cluster RABBITMQ_CONFIG_FILE=...`
didn't work as expected: `$(RABBITMQ_CONFIG_FILE)` made it to the
sub-make but not to the sub-make's recipe.

Using := fixes the problem.

Doing that is ok because assigning `$(RABBITMQ_CONFIG_FILE)` in the
environment or on make(1)'s command line will override the
target-specific variable anyway.
2020-03-17 18:38:20 +01:00
Jean-Sébastien Pédron b175b2e667 rabbitmq-run.mk: Re-use $(comma) from Erlang.mk 2020-03-17 18:34:54 +01:00
Luke Bakken d59d332bd1 Fix leading tabs 2020-03-16 07:52:23 -07:00
Michael Klishin 47e8053a41 (c) updates for 2020
Pair: @dumbbell.
2020-03-16 15:00:48 +03:00
Michael Klishin 982df58b0f rabbit_nodes_common:make/1: support node parts that are not strings
Such as atoms and binaries.

Pair: @dumbbell.
2020-03-16 15:00:48 +03:00
Gerhard Lazu 382565c507 Double-escape \ so that the config file is generated correctly
Thanks @lukebakken!

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-16 10:52:39 +00:00
Gerhard Lazu 7bfbdba2df Use a better colour for all debug logs
They were plain by default & are now blue which works really well with
Gruvbox Dark. I couldn't change just the debug color, had to redefine
them all.

cc @dumbbell @lukebakken

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-13 23:21:03 +00:00
Gerhard Lazu 1da5f922fe Keep test_rabbitmq_config_with_tls in sync with the default one
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-13 23:19:39 +00:00
Gerhard Lazu f54691f4b9 Enable colourful debug logging by default
When running the broker locally, in dev, this is what most of us want.
To change this, use e.g. RABBITMQ_LOG=info (previous default).

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-11 12:02:04 +00:00
Jean-Sébastien Pédron fa4b552a9b Update copyright (year 2020) 2020-03-10 15:26:49 +01:00
Jean-Sébastien Pédron 6d48b5f7d3 rabbitmq-run.mk: Set Ra's wal_sync_method to `sync`
This turns off WAL preallocation and saves 400+ MiB per node directory.

This setting only applies to nodes started with `make run-broker` or
from our testsuites. RabbitMQ default configuration remains unaffected.
2020-03-09 13:03:12 +01:00
Jean-Sébastien Pédron 979b6f6972 rabbitmq-dist.mk: Change the condition again to match $(PORJECT) instead
Using dependencies seemed sensible in the first place, but they are also
special cases like `rabbit` itself. In the end, it looks simpler to just
list rabbitmq-common and rabbitmq-amqp1.0-common in a blacklist and
install CLI for everything else.
2020-03-06 14:04:22 +01:00
Jean-Sébastien Pédron 7a8c74f617 rabbitmq-dist.mk: Consider $TEST_DEPS when installing CLI (or not)
Follow-up to commit 0e5e25d961.
2020-03-06 12:41:08 +01:00
Jean-Sébastien Pédron 0e5e25d961 rabbitmq-dist.mk: Don't install CLI if the project dost not depend on `rabbit`
This is the case of rabbitmq-common and rabbitmq-amqp1.0-common for
instance.
2020-03-06 12:25:12 +01:00
Gerhard Lazu 46ef666075 Use dev prometheus.erl in RabbitMQ master (3.9.x)
We want to test PRs such as
https://github.com/deadtrickster/prometheus.erl/pull/102
in RabbitMQ master (3.9.x) so that we can test fixes against other
master components, like OTP 23 (erlang-git).

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-06 09:04:07 +00:00
Gerhard Lazu 8fb9ce1450 Merge pull request #359 from rabbitmq/erlang-mk-query-deps
Add erlang.mk query-deps
2020-03-06 09:01:13 +00:00
Gerhard Lazu 24eb242135 Add erlang.mk query-deps* family of targets
After checking out this branch, run the following command in the
umbrella:

    make update-erlang-mk

This will enable the following command across all RabbitMQ deps:

    make query-deps

And this is what the output for one such dependency looks like:

    pwd
    /Users/gerhard/github.com/rabbitmq/3.9.x/deps/rabbitmq_management

    make query-deps
    rabbitmq_management: ranch hex https://hex.pm/packages/ranch 1.7.1
    rabbitmq_management: rabbit_common git_rmq https://github.com/rabbitmq/rabbitmq-common master
    rabbitmq_management: rabbit git_rmq https://github.com/rabbitmq/rabbitmq-server master
    rabbitmq_management: amqp_client git_rmq https://github.com/rabbitmq/rabbitmq-erlang-client master
    rabbitmq_management: cowboy hex https://hex.pm/packages/cowboy 2.6.1
    rabbitmq_management: cowlib hex https://hex.pm/packages/cowlib 2.7.0
    rabbitmq_management: rabbitmq_web_dispatch git_rmq https://github.com/rabbitmq/rabbitmq-web-dispatch master
    rabbitmq_management: rabbitmq_management_agent git_rmq https://github.com/rabbitmq/rabbitmq-management-agent master
    rabbit_common: rabbitmq_codegen git_rmq https://github.com/rabbitmq/rabbitmq-codegen master
    rabbit_common: lager hex https://hex.pm/packages/lager 3.8.0
    rabbit_common: jsx hex https://hex.pm/packages/jsx 2.9.0
    rabbit_common: ranch hex https://hex.pm/packages/ranch 1.7.1
    rabbit_common: recon hex https://hex.pm/packages/recon 2.5.0
    rabbit_common: credentials_obfuscation hex https://hex.pm/packages/credentials_obfuscation 1.1.0
    lager: goldrush git https://github.com/DeadZen/goldrush.git 0.1.9
    rabbit: rabbitmq_cli git_rmq https://github.com/rabbitmq/rabbitmq-cli master
    rabbit: syslog git https://github.com/schlagert/syslog 3.4.5
    rabbit: cuttlefish hex https://hex.pm/packages/cuttlefish 2.2.0
    rabbit: ranch hex https://hex.pm/packages/ranch 1.7.1
    rabbit: lager hex https://hex.pm/packages/lager 3.8.0
    rabbit: rabbit_common git_rmq https://github.com/rabbitmq/rabbitmq-common master
    rabbit: ra git https://github.com/rabbitmq/ra.git master
    rabbit: sysmon_handler hex https://hex.pm/packages/sysmon_handler 1.2.0
    rabbit: stdout_formatter hex https://hex.pm/packages/stdout_formatter 0.2.2
    rabbit: recon hex https://hex.pm/packages/recon 2.5.0
    rabbit: observer_cli hex https://hex.pm/packages/observer_cli 1.5.3
    rabbitmq_cli: rabbit_common git_rmq https://github.com/rabbitmq/rabbitmq-common master
    rabbitmq_cli: observer_cli hex https://hex.pm/packages/observer_cli 1.5.3
    observer_cli: recon hex https://hex.pm/packages/recon 2.5.0
    cuttlefish: getopt hex https://hex.pm/packages/getopt 1.0.1
    cuttlefish: lager hex https://hex.pm/packages/lager 3.7.0
    ra: elvis_mk git https://github.com/inaka/elvis.mk.git master
    ra: aten hex https://hex.pm/packages/aten 0.5.3
    ra: gen_batch_server hex https://hex.pm/packages/gen_batch_server 0.8.2
    amqp_client: rabbit_common git_rmq https://github.com/rabbitmq/rabbitmq-common master
    cowboy: cowlib git https://github.com/ninenines/cowlib 2.7.0
    cowboy: ranch git https://github.com/ninenines/ranch 1.7.1
    rabbitmq_web_dispatch: rabbit_common git_rmq https://github.com/rabbitmq/rabbitmq-common master
    rabbitmq_web_dispatch: rabbit git_rmq https://github.com/rabbitmq/rabbitmq-server master
    rabbitmq_web_dispatch: cowboy hex https://hex.pm/packages/cowboy 2.6.1
    rabbitmq_management_agent: rabbit_common git_rmq https://github.com/rabbitmq/rabbitmq-common master
    rabbitmq_management_agent: rabbit git_rmq https://github.com/rabbitmq/rabbitmq-server master

re https://github.com/ninenines/erlang.mk/pull/875

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-03-05 15:10:37 +00:00
Jean-Sébastien Pédron cb432fd664 rabbitmq-tools.mk: Only update `.travis.yml` if branches match
... between the current project and rabbitmq-common.

Like with `rabbitmq-components.mk`, this avoids to use an incorrect copy
if the current project uses a different branch or does not have e.g. a
`v3.8.x` branch (unlike rabbitmq-common).
2020-03-04 16:15:48 +01:00
Jean-Sébastien Pédron 54e290683d Travis CI: Set $current_rmq_ref based on Travis variables
We need to communicate this information to rabbitmq-components.mk so it
selects the right branch for each dependency.

By default, it would query git(1), but after Travis clones and possibly
merges branches, it does not have access to the information anymore.
Forunately, the Travis environment has everything we need.

$base_rmq_ref was already set properly in a previous commit.

If Travis is building a tag, $TRAVIS_BRANCH will contain the appropriate
value, so this works in this case as well.

We now also check if `rabbitmq-components.mk` is up-to-date.
2020-03-04 13:32:57 +01:00
Jean-Sébastien Pédron ec93c7dce3 Travis CI: Ensure Elixir is installed
To do so, we set the language to Elixir, even though almost all our
projects are written in Erlang. But we need Elixir for the RabbitMQ CLI.

Specifying Elixir as the language in Travis allows us to:
1. make sure Elixir is installed by Travis
2. specify the versions of both Erlang/OTP and Elixir

We also set an explicit install step. Not that we care about `mix
local.hex`, but we need to override the default Travis install step
which assumes this is an Elixir (mix) based project.

We take this opportunity to add Erlang/OTP 22.2 to the build matrix.

While here, we bring two fixes:
* Warnings reported by Travis are solved: the OS is set explicitly and
  `sudo` is removed.
* The "git checkout" gymnastic is replaced by simply setting
  `$base_rmq_ref`. This is a better solution to make sure the
  appropriate dependencies' branch is selected.
2020-03-04 10:51:21 +01:00
Jean-Sébastien Pédron 5dc227a6eb rabbitmq-run.mk: Skip builds in `make run-broker NOBUILD=1`
This can allow for faster RabbitMQ startup time when we know there is
nothing to compile.
2020-03-03 18:33:46 +01:00
Jean-Sébastien Pédron 15c47804ec rabbitmq-tools.mk: Don't add .travis.yml is there none in the first place
One has to manually add it the first it is used in a project.
2020-03-03 18:32:48 +01:00
Michael Klishin 2305b23cd9 Avoid using erlang:get_stacktrace/0 for improved OTP 23/24 compat 2020-02-27 22:25:46 +03:00
Jean-Sébastien Pédron dea423ad36 rabbit_env: Add `$RABBITMQ_CONFIG_FILES`
It is used to specify additional configuration files when using the
Cuttlefish format.

[#171491267]
2020-02-26 15:35:57 +01:00
Jean-Sébastien Pédron 3aa7dd1adb rabbit_env: Add $RABBITMQ_{PRODUCT_NAME,PRODUCT_VERSION,MOTD_FILE}
They are used to override the product name and version, and expand the
banners which are printed and logged on startup.

[#170054940]
2020-02-20 17:48:54 +01:00
Jean-Sébastien Pédron 7638a5439f rabbitmq-run.mk: Set console log level to debug
Exactly as we previously set the file log level to debug.

Note that it does not enable logging on the console, it only changes the
default log level if the user of `make run-broker` enables console
logging (using `make run-broker RABBITMQ_LOGS=-`).

[#171131596]
2020-02-13 09:54:45 +01:00
Gerhard Lazu f80c456370 Bump prometheus.erl & observer_cli to latest
Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-02-11 15:57:23 +00:00
Jean-Sébastien Pédron ca844d994b Merge pull request #354 from rabbitmq/extract_sd_notify
Remove systemd_notify_socket
2020-02-10 15:24:33 +01:00
Michael Klishin cf52b22f37 Transitonal step for OTP 23 [master] compat 2020-02-09 23:47:46 +03:00
Michael Klishin 4be3ff3f14 rabbit_misc:sort_field_table/1: support map arguments
This is convenient when working with objects deserialised
from JSON definitions.
2020-02-08 01:22:10 +03:00
Philip Kuryloski bc7e8e19f2 Remove systemd_notify_socket
The env var is now handled directly by rabbitmq_prelaunch rabbit_boot_state_systemd
2020-02-07 10:46:17 +01:00
Jean-Sébastien Pédron 994d0d4116 rabbit_env_SUITE: Check if $RABBITMQ_FEATURE_FLAGS is overridden
This happens when testing mixed-versions cluster in CI. This fixes the
test after commit 23a0a07e3a.

[#170149339]
2020-02-04 15:19:37 +01:00
Jean-Sébastien Pédron 780dd0de40 rabbit_env: Set $RABBITMQ_ENABLED_PLUGINS to an empty string to disable all plugins
The previous value accepted for this behavior was "NONE". But it's more
intuitive to set it to nothing.

`rabbitmq-run.mk` is also updated to allow `$RABBITMQ_ENABLED_PLUGINS`
to be overriden e.g. on the command line.
2020-01-24 12:54:43 +01:00
Jean-Sébastien Pédron ad8dbdaed6 rabbit_nodes_common: New name_type/1 function
It guesses the node name type, based on the host part of a node name.
I.e., if it contains at least a `.` character, it's a longname.

This matches the verification `net_kernel` does to make sure the node
name corresponds to the shortnames/longnames option.
2020-01-22 12:05:15 +01:00
Jean-Sébastien Pédron 82192ad881 rabbit_env: Improve how we locate the plugins directory
There are two changes in this patch:

1. In `get_default_plugins_path_from_node(), we base the search on
   `rabbit_common.app` instead of `code:lib_dir(rabbit_common)`.
   The latter only works if the application directory is named
   `rabbit_common` or `rabbit_common-$version`. This is not the case
   with a default Git clone of the repository because the directory will
   be named `rabbitmq-common`.

   Using `rabbit_common.app` is fine because it is inside the `ebin`
   directory, as all modules. It also brings another benefit: it is not
   subject to cover-compilation or preloading (which both get rid of the
   original module location).

2. The code to determine the plugins directory based on the directory
   containing the module (or `rabbit_common.app`) now takes into account
   plugin directories (as opposed to .ez archives). In this case, there
   is one less path component compared to an .ez archive.
2020-01-21 14:50:07 +01:00
Jean-Sébastien Pédron 23a0a07e3a rabbit_env: Record variables' origin
I.e. we record the fact that a particular value:
  * is the default value, or
  * comes from an environment variable, or
  * comes from querying a remote node

This required a significant refactoring of the module, which explains
the large diff.

At the same time, the testsuite was extended to cover more code and
situations.

This work permits us to move remaining environment variables checked by
`rabbit` to this module. They include:
  * $RABBITMQ_LOG_FF_REGISTRY
  * $RABBITMQ_FEATURE_FLAGS
  * $NOTIFY_SOCKET

[#170149339]
2020-01-21 12:46:06 +01:00
Jean-Sébastien Pédron 972643a99d rabbit_env: Fix an error reported by Dialyzer
value_is_yes() is always called with a string as argument.
2020-01-21 12:02:54 +01:00
Jean-Sébastien Pédron 006c4f3895 rabbitmq-dist.mk: Don't install CLI when testing rabbitmq-common
We don't need the CLI in this case and this would be a dependency
circle: rabbitmq-common <- rabbitmq-cli <- rabbitmq-common.
2020-01-21 12:02:54 +01:00
Jean-Sébastien Pédron 6331123a54 include/rabbit.hrl: Plugins' dependencies are a list of atom()
... not a list of tuples.
2020-01-16 11:48:37 +01:00
Jean-Sébastien Pédron 96ffc4bc3b Sort feature_flags/federation log categories alphabetically 2020-01-13 18:37:07 +01:00
Jean-Sébastien Pédron 39064b3d64 Add `rabbit_log_feature_flags` log category 2020-01-13 17:01:27 +01:00
Jean-Sébastien Pédron 5e4d4af150 rabbit_misc: Add `rabbitmq_related_module_attributes/0`
Compared to `all_module_attributes/0`, it only scans applications which
are related to RabbitMQ: either a RabbitMQ core application or a plugin
(i.e. an application which depends on `rabbit`).

On my laptop, this significantly reduce the time to query module
attributes in the case of feature flags: it goes from 830 ms to 235 ms
just by skipping all Erlang/OTP applications are third-party
dependencies.

This makes a small improvement to RabbitMQ startup time, which is
visible for developers mainly, not for a production instance.
2020-01-13 16:59:07 +01:00
Michael Klishin 818362766d (c) bump
(cherry picked from commit 013ba83abcce06c52c12e2a41e728c1e2399be60)
2019-12-29 05:55:51 +03:00
Michael Klishin 4e5123c1de rabbit_writer state: gc_threshold => writer_gc_threshold, references #343 2019-12-24 23:40:42 +03:00
Michael Klishin d64dcc0a29 Bump default GC threshold to the same 1GB 2019-12-20 08:03:28 +03:00
Michael Klishin d5f67e1f9f Merge branch 'configurable_gc_threshold' of https://github.com/nyczol/rabbitmq-common into nyczol-configurable_gc_threshold 2019-12-20 03:34:11 +03:00
Jean-Sébastien Pédron 6ba6dd63f5 Merge pull request #344 from rabbitmq/lrb-mqtt-stomp-start-cluster
Add MQTT and STOMP port calc to start-cluster
2019-12-18 11:41:34 +01:00
Luke Bakken 101371778a Remove RABBITMQ_GENERATED_CONFIG_DIR
No longer applies after merge of rabbitmq/rabbitmq-server#2180
2019-12-16 11:00:12 -08:00
Jean-Sébastien Pédron e0ea1432ca rabbitmq-tools.mk: Add `sync-gitignore-from-master` helper
To be used in branches other than `master`. It will take `.gitignore`
from master and replace the current copy with it.

Like a few other targets, it supports `DO_COMMIT=yes` to commit the
change as well.
2019-12-13 14:40:59 +01:00
Luke Bakken edf8f892d4 Add MQTT and STOMP port calc to start-cluster 2019-12-12 07:35:38 -08:00
Jean-Sébastien Pédron 179d1657a8 rabbitmq-components.mk: Locate Umbrella relative to $(APPS_DIR)/my_app as well
When we are running Makefile recipes from an application under
`$(APPS_DIR)`, we want to locate the Umbrella correctly to:
- set `$(DEPS_DIR)` accordingly
- prevent `make distclean` from removing `$(DEPS_DIR)`

Before this change and after `rabbit/apps/rabbitmq_prelaunch` was added,
running `make distclean` in `rabbit` removed everything under
`$(DEPS_DIR)`.
2019-12-12 13:04:23 +01:00
Jean-Sébastien Pédron 0fb6f466e4 rabbit_env: Fix typo in comment about Dialyzer 2019-12-12 13:01:09 +01:00
Jean-Sébastien Pédron e5b3d45726 rabbit_env: Fix Dialyzer warnings
There was one legitimate warning in `get_enabled_plugins()`:
`get_prefixed_env_var()` already takes care of converting an empty
string to false.

The other warning is because `loading_conf_env_file_enabled()` returns a
boolean when compiled for tests, but always true when compiled for
production. Dialyzer only sees the second case and thinks the cases
where the function returns false will never happen.
2019-12-12 12:18:41 +01:00
ANycz e31131dca1 make garbage collector threshold configurable 2019-12-11 21:35:53 +01:00
Jean-Sébastien Pédron a7a305dca2 include/rabbit.hrl: Move Erlang/OTP required versions to `rabbitmq_prelaunch` 2019-12-11 14:45:39 +01:00
Jean-Sébastien Pédron 90d5c28445 rabbitmq-dist.mk: Empty `$(DIST_AS_EZS)` to distribute plugins as dirs
... instead of `.ez` archives.

The default is still to create `.ez` archives for all RabbitMQ
components & plugins.

However if `$(USE_RABBIT_BOOT_SCRIPT)` is set (experimental and
undocumented for now), they are distributed as directories.
2019-12-11 14:45:39 +01:00
Jean-Sébastien Pédron e2f4fc3e04 rabbitmq-run.mk: Don't run rabbitmq-plugins(8) to enable plugins
This is handled by the `rabbitmq_prelaunch` application now, based on
the value of `$RABBITMQ_ENABLED_PLUGINS`.

`$(RABBITMQ_ENABLED_PLUGINS_FILE)` depended on `dist`. This dependency
was moved to individual `run-*` and `start-*` targets.

While here, re-use `test-dist` instead of `dist` if the build was
already done for tests.

The testsuites default to run `make test-dist` as a first step.
Therefore later, when it starts a node, it should re-use that instead of
depending on `make dist` which will rebuild the tested project and
remove test dependencies from plugins.

This is useful (and mandatory in fact) now that `rabbit` is packaged
like plugins because, in the case of rabbitmq-erlang-client for
instance, the broker is a `$(TEST_DEPS)`: if starting a node runs `make
dist`, the broker will be removed.
2019-12-11 14:45:39 +01:00
Jean-Sébastien Pédron 12d48ff717 rabbitmq-dist.mk: Fix concurrent runs of `make {,test-}dist` and `make install-cli`
The fix depends on the presence of lockf(1) or flock(1).
2019-12-11 14:45:39 +01:00
Jean-Sébastien Pédron 5840834fa8 rabbitmq-dist.mk, rabbitmq-run.mk: Copy scripts & escripts
... to the plugin being worked on, instead of locating `rabbit` and
taking the scripts there.

It greatly simplifies the use of RabbitMQ and plugins inside a
development working copy because the layout is closer to what we would
have in a package. I.e. there are far less special cases.
2019-12-11 14:45:39 +01:00
Jean-Sébastien Pédron 405f86f39b rabbitmq-dist.mk: Create an .ez archive for `rabbit` too
The goal is to distribute RabbitMQ core (the `rabbit` Erlang
application) exactly as we distribute plugins. This simplifies the
startup script and CLI tools when we have to setup Erlang code search
path.
2019-12-11 14:45:39 +01:00
Jean-Sébastien Pédron 11c29bfb29 Add `rabbit_log_prelaunch` log category
While here, sort categories alphabetically and add missing ones to the
declared type().
2019-12-11 14:45:38 +01:00
Jean-Sébastien Pédron 77b655bc71 rabbit_env: New module to prepare context based on environment
... and default values.

It can also query a remote node for some specific values. The use case
is the CLI which should know what the RabbitMQ node it controls uses
exactly.

It supports several new environment variables:

  RABBITMQ_DBG:
    Used to setup `dbg` for some simple tracing scenarios.

  RABBITMQ_ENABLED_PLUGINS:
    Used to list plugins to enable automatically on node startup.

  RABBITMQ_KEEP_PID_FILE_ON_EXIT:
    Used to indicate if the PID file should be removed or kept when the
    node exits.

  RABBITMQ_LOG:
    Used to configure the global and per-category log levels and enable
    ANSI colors.
2019-12-11 14:45:35 +01:00
Jean-Sébastien Pédron 5b13de0927 rabbitmq-dist.mk: Ensure `make test-dist` is not always out-of-date
`ebin/test` is always touch(1)'d by Erlang.mk, which made the list of
dependencies of an .ez archive newer than the archive itself. This caused the
archive to be recreated.

While here, set `TEST_DIR` to something random in the case of `make
test-dist`: this way, rebuilding all testsuites is skipped by Erlang.mk.
Yes, this is a hack.
2019-12-05 14:54:16 +01:00
Jean-Sébastien Pédron ba498049ed rabbit_misc: Use PowerShell to check process aliveness on Windows
At least on the Windows Server 2019 AWS EC2 image, the `tasklist`
command is unavailable.

If that's the case, we fallback to using a PowerShell oneliner. It's not
the default, just in case PowerShell is unavailable.
2019-12-05 12:29:41 +01:00
Jean-Sébastien Pédron da3e784a7a rabbitmq-build.mk: Don't add Elixir lib dir to `$ERL_LIBS`
This is now done in xrefr (`mk/xrefr`) and rabbimq-ct-helpers when
needed.

This has several benefits:
  * This fixes `make run-broker` on Windows because the computed
    `$ERL_LIBS` was invalid there.
  * This saves a lot of Makefile processing time, because elixir(1) is
    quite slow to startup. On my laptop, a complete build in
    rabbitmq-server-release from 8.5 seconds to 3 seconds.
2019-12-05 12:29:30 +01:00
Michael Klishin 388f514e1a rabbit_misc:append_rpc_all_nodes/4: wrap non-list return values
into a list, as the function implies.

All current call sites use it to call functions that return lists.
However, rabbitmq/rabbitmq-cli#389 breaks this cycle.
2019-12-05 06:50:15 +03:00
Luke Bakken decd320133 Merge pull request #340 from rabbitmq/lrb-epmd-starter-tweak
epmd-starter improvements
2019-11-19 10:18:22 -08:00
Michael Klishin 5784240b99 Extract parse_bool/1 and parse_int/1 from rabbit_mgmt_util
A follow-up to rabbitmq/rabbitmq-management#749.
2019-11-19 19:10:48 +03:00
Michael Klishin 4361cd6ddf Merge pull request #339 from rabbitmq/rabbitmq-management-749
Move some helpers from rabbitmq-management
2019-11-19 02:27:13 +03:00
Luke Bakken b4b7549ad3 Special-case x-queue-type classic/undefined
Fixes #341
2019-11-15 13:33:43 -08:00
Luke Bakken 7eb5b3c5d5 epmd-starter improvements
* Use `noinput`
* Use `-s erlang halt` to skip small `eval` overhead
* Use `no_dot_erlang` boot file since we do not want user customizations to interfere
2019-11-14 10:40:44 -08:00
Michael Klishin 5aef852257 Move some helpers from rabbitmq-management
Part of rabbitmq/rabbitmq-management#749.
2019-11-12 03:07:14 +03:00
Michael Klishin d0384fabfe Merge branch 'master' into reserve-qq-file-handles 2019-10-24 11:57:40 +03:00
Yury.Alioshinov 80dc973aae add forgotten ldap type 2019-10-20 23:38:52 +03:00
Michael Klishin f03f4886c3 Naming 2019-10-17 00:07:42 +03:00
dcorbacho 2c56e75158 Reserve the 3 fixed ra file handles
[#169063174]
2019-10-16 10:44:21 +01:00
dcorbacho df0f34d1cb Reserve file handles for quorum queues
These should be taken into account into the limits, but always be granted.
Files must be reserved by the queues themselves using `set_reservation/0` or
`set_reservation/1`. This is an absolute reservation that increases or
decreases the number of files reserved to reach the given amount on every
call.

[#169063174]
2019-10-15 15:16:10 +01:00
Michael Klishin 6798bc3575 Make license line in startup banner more specific 2019-10-04 20:12:44 +03:00
Jean-Sébastien Pédron 2625f43086 rabbitmq-run.mk: Fix generated rabbitmq-server configuration
To configure the AMQP TCP listener, the key is `tcp_listeners`, not
`listeners`.
2019-09-13 13:47:16 +02:00
kjnilsson 353382c94e Change Ra dep back to git master
To more easily align RabbitMQ and Ra developement
2019-09-13 09:23:33 +01:00
kjnilsson 44d01eb9d0 update ra dep 2019-09-04 11:02:03 +01:00
Jean-Sébastien Pédron ad52a23bb5 rabbitmq-run.mk: Set $RABBITMQ_BASE
Otherwise on Windows, the broker may read system files: this would
pollute the test environment.
2019-09-03 18:14:38 +02:00
Jean-Sébastien Pédron 3dd58ae12a rabbitmq-run.mk: Bump `rabbitmqctl wait` timeout from 10 to 60 seconds
... when we wait for a node started in the background.

This helps when the PID is written asynchronously by the Erlang node
instead of the rabbitmq-server(8) script: in this case, the `rabbitmqctl
wait` command may start to wait earlier in the former situation than the
latter one, and thus timeout earlier.
2019-09-03 18:10:48 +02:00
Jean-Sébastien Pédron f6780f1bec rabbitmq-dist.mk: Sort files inside the .ez archives
This helps with reproducible builds.
2019-09-03 18:10:39 +02:00
Jean-Sébastien Pédron bb5022ccec rabbitmq-dist.mk: Ensure rsync(1) arg is a Unix-like path
On Windows, if we pass it a Windows-native path like `C:\User\...` or
even something with forward slashes, rsync(1) will consider that `C`
(before the colon) is a hostname and it should try to connect to it.

Using `cygpath.exe` on Windows converts the Windows path to a Unix-like
one (e.g. `/c/Users/...`).
2019-09-03 12:02:20 +02:00
Michael Klishin c5df5043e9 rabbit_types:vhost/0 now delegates to vhost:name/0
[#166298298]
2019-08-30 10:58:34 +02:00
Diana Corbacho b94e01c90c The vhost record moved to a versioned record in rabbitmq-server
Add metadata to virtual hosts

[#166298298]

rabbit_vhost: use record defaults

The vhost record moved to a versioned record in rabbitmq-server

Co-Authored-By: Michael Klishin <mklishin@pivotal.io>
2019-08-30 10:19:50 +02:00
Jean-Sébastien Pédron a1fb3fcc37 Update erlang.mk 2019-08-29 20:44:37 +02:00
Michael Klishin 735c47eca9 Depend on credentials_obfuscation 1.1.0 2019-08-20 13:21:40 +10:00
Michael Klishin 91dd7dd1ab A typo 2019-08-20 13:13:07 +10:00
Michael Klishin b4990145de Use credentials_obfuscation from Hex 2019-08-20 13:10:07 +10:00
Michael Klishin b7f3114ebd Merge pull request #334 from rabbitmq/optimise-erlang-timers
Replace timer:send_after/3 by erlang:send_after/3
2019-08-17 08:45:29 +10:00
Michael Klishin 485888bbcd Switch to eunit macros for assertions 2019-08-17 05:47:42 +10:00
codeadict 5fb17b0943 Add stop{1,3} functions to gen_server2
These functions utilize proc_lib:stop, which in turn utilizes sys:terminate.

They were introduced in
9d7d1207ff.

Closes: #266
2019-08-16 12:14:48 -04:00
Diana Corbacho b580595ea4 Replace timer:send_after/3 by erlang:send_after/3
[#167926549]
2019-08-16 15:29:38 +01:00
Michael Klishin 65675b5f1f Merge pull request #332 from rabbitmq/rabbitmq-erlang-client-123-crypted-password-in-state
Enable credential obfuscation
2019-08-16 12:14:33 +10:00
Jean-Sébastien Pédron 57c14b1214 rabbitmq-{build,run,tools}.mk: Pass several variables to sub-makes
This saves a lot of time because:
1. we don't spawn a shell each time to compute the same value;
2. elixir(1) has a long startup time.

In my tests, a no-op gmake in `rabbit` goes from 2.5 seconds to 0.9
seconds.
2019-08-14 11:29:07 +02:00
Jean-Sébastien Pédron 79d7969c16 rabbitmq-run.mk: No need to find erl_call(1)
We don't use it anymore in the Makefiles. This speeds up the build
because we don't spawn a shell for something useless in the end.
2019-08-14 11:27:06 +02:00
Jean-Sébastien Pédron 16b702e0ca rabbitmq-run.mk: Use GNU Make functions to prepare $(DIST_ERL_LIBS)
... instead of Unix commands and a one-liner which assumes that `:` is
the path separator. This speeds up the build because we don't spawn a
shell.

While here, also remove `$(APPS_DIR)` from `$(ERL_LIBS)`.
2019-08-14 11:25:27 +02:00
Arnaud Cogoluègnes e4a935c49f Use credentials obfuscation application
rabbit_pbe is now delegating calls to the credentials obfuscation
app/library.

[#167070941]

References rabbitmq/rabbitmq-erlang-client#123
2019-08-13 09:50:25 +02:00
Arnaud Cogoluègnes dceeee8e31 Merge branch 'master' into rabbitmq-erlang-client-123-crypted-password-in-state 2019-08-12 14:02:09 +02:00
Michael Klishin 407cbfd503 Bump Lager to 3.8.0 2019-08-11 01:47:34 +10:00
Jean-Sébastien Pédron 0b20c2dd6b rabbitmq-tools.mk: Fix tags counting in `commits-since-release`
We have to apply the same tag filtering when counting them as the one
done by git-describe(1).

This fixes the following error:

    fatal: No names found, cannot describe anything

This issue was hit when there were tags in the project, but they were
all filtered out by git-describe(1).
2019-08-09 11:00:15 +02:00
Jean-Sébastien Pédron 205042d593 Update erlang.mk 2019-08-02 09:53:18 +02:00
Michael Klishin f2e147b025 Bump observer_cli and sysmon_handler deps 2019-08-01 17:11:57 +03:00
Arnaud Cogoluègnes 9f98340fd2 Add credentials obfuscation module
WIP, the secret is hardcoded, which is obviously not secured. It is
enough though to see if modules/applications manipulating credentials
can use it to avoid those credentials to end up in logs when the state
of crashed processes is dumped.

[#167070941]

References rabbitmq/rabbitmq-erlang-client#123
2019-07-29 16:09:40 +02:00
Jean-Sébastien Pédron 4af40e2d25 rabbitmq-run.mk: Compute MQTT and STOMP TCP ports for `run-broker`
They are based on `$(RABBITMQ_NODE_PORT)`, like the management plugin's
computed port.
2019-07-26 13:20:57 +02:00
Arnaud Cogoluègnes d01011d0f5 rabbitmq-tools.mk: Handle RabbitMQ components without tags
... in `commits-since-release`.

Before this change, the script was expecting at least one tag so that
git-describe(1) worked. Without that, it would fail with:

fatal: No names found, cannot describe anything.

Now, if a component has no tag, it will display "New in this release!".

Patch from @dumbbell
2019-07-12 16:53:05 +02:00
Arnaud Cogoluègnes b9a7be7e64 Add OAuth 2 plugin to rabbitmq-components.mk 2019-07-09 16:04:48 +02:00
Arnaud Cogoluègnes 80c8a09c3b Merge pull request #331 from rabbitmq/oauth2-credential-expiration-support
Support client-driven refresh of expiring credentials
2019-07-04 10:57:24 +02:00
Jean-Sébastien Pédron ed3dba3670 rabbitmq-dist.mk: Don't assume the plugin lives in `$(DEPS_DIR)`
The application to "package" as a plugin (an .ez archive) might be under
`$(APPS_DIR)`. Therefore now, the all the variables and recipes are
created from the path to the application not just its name.
2019-07-01 14:41:53 +02:00
Arnaud Cogoluègnes 55e7881c4a Merge branch 'master' into oauth2-credential-expiration-support 2019-07-01 11:42:37 +02:00
Jean-Sébastien Pédron e887709ada rabbitmq-dist.mk: Exclude `ebin/dep_built` from the files to distribute in plugins
This file is useful at build time only (for Erlang.mk) and it breaks the
build of the .ez archive otherwise.
2019-06-28 23:48:43 +02:00
Jean-Sébastien Pédron 8d1e9ce40a Update erlang.mk 2019-06-28 16:01:30 +02:00
Jean-Sébastien Pédron 095294be04 rabbitmq-components.mk: Force rebuild of all RabbitMQ components
With the update of Erlang.mk, dependencies are not rebuilt anymore by
default, except if `FULL=1` is set.

This behavior is not adapted to the work on RabbitMQ where many
components are split into many repositories, and we work on several of
them at the same time.

Therefore, the idea of this commit is to tell Erlang.mk to always visit
dependencies which are RabbitMQ components. Other dependencies are only
built once the first time.

[#166980833]
2019-06-28 15:54:23 +02:00
Jean-Sébastien Pédron 89a188c4e9 rabbitmq-mix.mk: Moved to rabbitmq-server-release 2019-06-26 18:49:40 +02:00
Jean-Sébastien Pédron f12002e2f3 rabbitmq-*test.mk: Fix latest regressions on our side w.r.t *-on-concourse
Unfortunately, the *-on-concourse targets still don't work: fly(1), the
Concourse CLI, looks to have regressed even more: it doesn't upload all
inputs. Half of them are just empty directories.

Obviously, compiling anything fails because if this.
2019-06-25 18:23:54 +02:00
Michael Klishin 10b4cb1c48 WIP: credential expiration support prototyping 2019-06-22 18:40:01 +03:00
D Corbacho 683bed4802 Merge pull request #329 from rabbitmq/rabbitmq-server-2030
Make default worker pool size configurable
2019-06-13 15:14:43 +01:00
Michael Klishin 29c933a4cd Make default worker pool size configurable
Part of rabbitmq/rabbitmq-server#2030.
2019-06-13 16:55:16 +03:00
Michael Klishin dd6e521204 New Lager sink for Shovel
References rabbitmq/rabbitmq-shovel#60.

[#166627333]
2019-06-12 18:33:21 +03:00
Michael Klishin cb42235776 Merge branch 'master' into rabbitmq-server-1767-protocol-specific-ctx-in-authn-authz 2019-06-07 19:53:26 +03:00
Gerhard Lazu a4b5953d78 Update rabbitmq-components.mk 2019-06-03 02:24:18 +01:00
Arnaud Cogoluègnes a930be7489 Modify authz to propagate protocol-specific context
References rabbitmq/rabbitmq-server#1767
2019-05-29 10:35:48 +02:00
Jean-Sébastien Pédron 6b16a1f2f5 rabbitmq-components.mk: Take observer_cli from Hex.pm 2019-05-17 15:17:48 +02:00
Michael Klishin b4feede8b2 observer_cli 1.5.0 2019-05-17 08:38:02 +03:00
Michael Klishin ef0d843ba5 Bump Recon 2.5.0 for Erlang 22 compat, depend on our fork of observer_cli that uses it 2019-05-16 23:22:26 +03:00
Michael Klishin 8ff556bde2 Depend on observer_cli 1.4.5 2019-05-14 11:46:38 +03:00
Michael Klishin 69598d36fb rabbitmq-components.mk: add observer_cli dependency
For rabbitmq/rabbitmq-cli#353 and rabbitmq/rabbitmq-server#2006.
2019-05-13 16:40:02 +03:00
Gerhard Lazu 05b3f9dedd Fix start-brokers / start-cluster make target
`-ra data_dir` is not necessary. It was also missing a \
2019-05-09 18:02:14 +01:00
Gerhard Lazu df416530ce Update prometheus to v4.3.0 to benefit from global_labels
deadtrickster/prometheus.erl#91
2019-05-01 13:13:58 +01:00
Luke Bakken 70d2020f81 Update rabbitmq-components.mk 2019-04-30 16:22:59 -07:00
Jean-Sébastien Pédron a0a044ce5e rabbit_pretty_stdout: Remove module
It was replaced by the external library, `stdout_formatter`, which is
based on this module.

[#164931055]
2019-04-30 14:33:27 +02:00
Jean-Sébastien Pédron 72cb6bbe6d rabbitmq-components.mk: Pin stdout_formatter version to 0.2.2
[#164931055]
2019-04-30 14:28:46 +02:00
Michael Klishin 9eb9686795 Merge branch 'master' into rabbitmq-erlang-client-91 2019-04-25 21:10:36 +03:00
Daniil Fedotov e9cd793eb4 Move rabbit_queue_collector to rabbit_common repo.
Collector is used by a connection supervisor, which may be on
the client side for direct connections.

Addresses rabbitmq-erlang-client#91
2019-04-23 16:47:23 -04:00
Michael Klishin a8495e1c30 channel_exchange_metrics now has one more metric: dropped unroutable messages
Part of rabbitmq/rabbitmq-server#1904.

[#165548314]
2019-04-23 23:22:58 +03:00
Gerhard Lazu 3bed6894d7 Merge branch 'rabbitmq-prometheus'
[#164376052]
2019-04-22 21:51:47 +01:00
Jean-Sébastien Pédron b0b2963023 rabbit_pbe: Default cipher's name depends on Erlang version
In Erlang 22, the name is now `aes_256_cbc`.

The default cipher/hash/iterations are also set in rabbit's application
default environment. I'm going to remove those default values there
because the code already queries this module if they are missing from
the application environment.
2019-04-19 16:03:52 +02:00
Jean-Sébastien Pédron 3d93ed3d90 rabbit_pbe: Use the new `crypto:supports/1` function in Erlang 22
This fixes a crash of the call to `crypto:cipher_info/1` later because
the ciphers list returned by `crypto:supports/0` contains more ciphers:
"old aliases" are added to that list and those aliases are unsupported
by `crypto:cipher_info/1`.
2019-04-19 11:28:40 +02:00
Michael Klishin 39528ba08b rabbit_misc: introduce rabbitmq_and_erlang_versions/0
Combines version/0 and otp_release/0 so that both can be retrieved
by rabbitmqctl cluster_status in one shot.
2019-04-19 04:10:42 +03:00
Gerhard Lazu fbe2ac4cdb Allow RABBITMQ_CONFIG_FILE make variable to be overwritten 2019-04-17 13:27:31 +01:00
Michael Klishin 6adeb6a220 rabbit_resource_monitor_misc:parse_information_unit/1: coerce input to a list
Elixir passes them in as Erlang binaries.
2019-04-16 17:10:02 +04:00
Michael Klishin a66df54b1a Revert "Clarify"
This reverts commit 7c9f170cee.

CLI tools cannot use this function as it logs errors.
`rabbit_resource_monitor_misc:parse_information_unit/1` is a better fit.
2019-04-16 16:11:22 +04:00
Michael Klishin 7c9f170cee Clarify 2019-04-16 16:02:10 +04:00
Gerhard Lazu 0e7a68cfc9 Add rabbitmq_prometheus dep
[#164376052]
2019-04-16 12:06:44 +01:00
Jean-Sébastien Pédron 052697a3e7 Merge pull request #323 from rabbitmq/blacklist-tls1.3-until-client-implementation-is-finished
rabbit_ssl_options: Blacklist TLS 1.3 until Erlang client implementation is finished
2019-04-11 14:11:58 +02:00
Jean-Sébastien Pédron 858bd20704 rabbit_ssl_options: Blacklist TLS 1.3 until Erlang client implementation is finished
Erlang 22 will introduce TLS 1.3, but at the time of this commit, only
the server side is implemented. If the Erlang client requests TLS 1.3, the
server will accept but the client will either hang or crash.

So for now, just blacklist TLS 1.3 to avoid any issues, even on the
server side, just to be safe.

[#165214130]
2019-04-11 14:02:52 +02:00
Loïc Hoguin 1755b82ca1 Don't support aes_ctr ciphers until OTP-22+ 2019-04-09 12:21:12 +02:00
Jean-Sébastien Pédron b90088f63c rabbit_misc: Generate a `NEW_PID_EXT`-based binary in compose_pid/4
The `creation` field might not fit into one byte which makes the
`PID_EXT` format unsuitable for this case.

The `NEW_PID_EXT` format is supported since Erlang 19.0, so it is safe
to always use it, no matter the value of `creation`, because RabbitMQ
3.7+ requires at least Erlang 19.3+.

References #313.
2019-04-08 11:35:31 +02:00
Michael Klishin f90e81610f Merge pull request #319 from rabbitmq/rabbit-common-318
Handle missing getconf command
2019-04-03 08:43:11 +03:00
Luke Bakken affc3b3991 Handle missing getconf command
Previous behavior is to crash, this is more forgiving

Fixes #318
2019-04-02 10:09:39 -07:00
Loïc Hoguin d077ea6a20 Support both PID_EXT and NEW_PID_EXT simultaneously 2019-04-02 14:23:04 +02:00
Michael Klishin 35cf0b48c3 Merge pull request #311 from rabbitmq/rabbitmq-auth-backend-cache-20
Cache vhost access requests using client IP address only
2019-04-01 02:29:07 +03:00
Jean-Sébastien Pédron d8dd5c623a Merge pull request #316 from rabbitmq/lxv-vm-memory-monitor-fix
vm_memory_monitor: handle KB as well as kB
2019-03-29 14:08:16 +01:00
kjnilsson c206aa0819 vm_memory_monitor: handle KB as well as kB
There are cases (e.g. inside LXC) where the unit reported in /proc/meminfo uses
KB instead of kB. Handle this case.
2019-03-29 11:12:47 +00:00
Michael Klishin 49b02019eb Dialyzer: disable no_match for decompose_pid/1
which has code matching on a constant conditional to OTP version.

Follow-up to #313.
2019-03-26 15:25:56 +03:00
Loïc Hoguin c0d58226c5 We don't support aes_ctr before OTP-22
The cipher was not available via the EVP interface before
Erlang/OTP-22.
2019-03-26 10:55:56 +01:00
Michael Klishin 16d4e55d90 Merge branch 'master' into new_pid_ext-otp22 2019-03-26 11:56:19 +03:00
Michael Klishin 42b8c32cf5 Merge pull request #308 from rabbitmq/improve-rabbit-pbe-otp22
Make rabbit_pbe work for OTP-22
2019-03-26 11:56:01 +03:00
Michael Klishin 774d92cc00 gen_server2: don't emit deprecation warnings on OTP 22
This is a transitional step to get rabbit_common to compile
on OTP 22.
2019-03-26 11:52:29 +03:00
Loïc Hoguin a35d8567b0 Support the NEW_PID_EXT format introduced in OTP-22
In OTP-22 the Creation field has been increased to be 32 bits.
For now we only need to handle it when using term_to_binary
and parsing the result manually.
2019-03-26 08:59:57 +01:00
Luke Bakken 1789c5fc5c Update authz_data type to include binaries 2019-03-25 14:46:52 -07:00
Luke Bakken 7889ad3425 Finish converting check_vhost_access/3 to new API 2019-03-22 13:10:27 -07:00
Luke Bakken a4767a772a Modify check_vhost_access/3 to use map of data
Part of rabbitmq/rabbitmq-auth-backend-cache#20
2019-03-22 07:21:59 -07:00
Jean-Sébastien Pédron 0d0cbadf6b rabbitmq-hexpm.mk: Always download the latest hexpm-cli
As of this commit, it should still be version 0.3.0.
2019-03-21 15:51:08 +01:00
Michael Klishin fb44b03d3b Update test expectations to match the change in 882876297b 2019-03-20 12:22:02 +03:00
Spring Operator 882876297b URL Cleanup
This commit updates URLs to prefer the https protocol. Redirects are not followed to avoid accidentally expanding intentionally shortened URLs (i.e. if using a URL shortener).

# HTTP URLs that Could Not Be Fixed
These URLs were unable to be fixed. Please review them to see if they can be manually resolved.

* http://blog.listincomprehension.com/search/label/procket (200) with 1 occurrences could not be migrated:
   ([https](https://blog.listincomprehension.com/search/label/procket) result ClosedChannelException).
* http://dozzie.jarowit.net/trac/wiki/TOML (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/TOML) result SSLHandshakeException).
* http://dozzie.jarowit.net/trac/wiki/subproc (200) with 1 occurrences could not be migrated:
   ([https](https://dozzie.jarowit.net/trac/wiki/subproc) result SSLHandshakeException).
* http://e2project.org (200) with 1 occurrences could not be migrated:
   ([https](https://e2project.org) result AnnotatedConnectException).
* http://erlang.org/doc/apps/erts/erl_ext_dist.html (200) with 1 occurrences could not be migrated:
   ([https](https://erlang.org/doc/apps/erts/erl_ext_dist.html) result ConnectTimeoutException).
* http://erlang.org/doc/man/erlang.html (200) with 1 occurrences could not be migrated:
   ([https](https://erlang.org/doc/man/erlang.html) result ConnectTimeoutException).
* http://nitrogenproject.com/ (200) with 2 occurrences could not be migrated:
   ([https](https://nitrogenproject.com/) result ConnectTimeoutException).
* http://proper.softlab.ntua.gr (200) with 1 occurrences could not be migrated:
   ([https](https://proper.softlab.ntua.gr) result SSLHandshakeException).
* http://yaws.hyber.org (200) with 1 occurrences could not be migrated:
   ([https](https://yaws.hyber.org) result AnnotatedConnectException).
* http://choven.ca (503) with 1 occurrences could not be migrated:
   ([https](https://choven.ca) result ConnectTimeoutException).

# Fixed URLs

## Fixed But Review Recommended
These URLs were fixed, but the https status was not OK. However, the https status was the same as the http request or http redirected to an https URL, so they were migrated. Your review is recommended.

* http://fixprotocol.org/ (301) with 1 occurrences migrated to:
  https://fixtrading.org ([https](https://fixprotocol.org/) result SSLHandshakeException).
* http://erldb.org (UnknownHostException) with 1 occurrences migrated to:
  https://erldb.org ([https](https://erldb.org) result UnknownHostException).
* http://host (UnknownHostException) with 1 occurrences migrated to:
  https://host ([https](https://host) result UnknownHostException).
* http://host:port/foo (UnknownHostException) with 2 occurrences migrated to:
  https://host:port/foo ([https](https://host:port/foo) result UnknownHostException).
* http://www.cs.indiana.edu/~burger/fp/index.html (301) with 1 occurrences migrated to:
  https://cs.indiana.edu/~burger/fp/index.html ([https](https://www.cs.indiana.edu/~burger/fp/index.html) result 404).

## Fixed Success
These URLs were switched to an https URL with a 2xx status. While the status was successful, your review is still recommended.

* http://cloudi.org/ with 27 occurrences migrated to:
  https://cloudi.org/ ([https](https://cloudi.org/) result 200).
* http://en.wikipedia.org/wiki/X86-64 with 1 occurrences migrated to:
  https://en.wikipedia.org/wiki/X86-64 ([https](https://en.wikipedia.org/wiki/X86-64) result 200).
* http://erlware.org/ with 1 occurrences migrated to:
  https://erlware.org/ ([https](https://erlware.org/) result 200).
* http://inaka.github.io/cowboy-trails/ with 1 occurrences migrated to:
  https://inaka.github.io/cowboy-trails/ ([https](https://inaka.github.io/cowboy-trails/) result 200).
* http://lukego.livejournal.com/6753.html with 1 occurrences migrated to:
  https://lukego.livejournal.com/6753.html ([https](https://lukego.livejournal.com/6753.html) result 200).
* http://ninenines.eu with 6 occurrences migrated to:
  https://ninenines.eu ([https](https://ninenines.eu) result 200).
* http://semver.org/ with 1 occurrences migrated to:
  https://semver.org/ ([https](https://semver.org/) result 200).
* http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html with 1 occurrences migrated to:
  https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html ([https](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html) result 200).
* http://www.actordb.com/ with 2 occurrences migrated to:
  https://www.actordb.com/ ([https](https://www.actordb.com/) result 200).
* http://www.cs.kent.ac.uk/projects/wrangler/Home.html with 1 occurrences migrated to:
  https://www.cs.kent.ac.uk/projects/wrangler/Home.html ([https](https://www.cs.kent.ac.uk/projects/wrangler/Home.html) result 200).
* http://www.erlang.org/ with 2 occurrences migrated to:
  https://www.erlang.org/ ([https](https://www.erlang.org/) result 200).
* http://www.mail-archive.com/asn1@asn1.org/msg00460.html with 1 occurrences migrated to:
  https://www.mail-archive.com/asn1@asn1.org/msg00460.html ([https](https://www.mail-archive.com/asn1@asn1.org/msg00460.html) result 200).
* http://www.rabbitmq.com/ with 2 occurrences migrated to:
  https://www.rabbitmq.com/ ([https](https://www.rabbitmq.com/) result 200).
* http://www.rabbitmq.com/amqp-0-9-1-errata.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/amqp-0-9-1-errata.html ([https](https://www.rabbitmq.com/amqp-0-9-1-errata.html) result 200).
* http://www.rabbitmq.com/memory.html with 1 occurrences migrated to:
  https://www.rabbitmq.com/memory.html ([https](https://www.rabbitmq.com/memory.html) result 200).
* http://www.rebar3.org with 1 occurrences migrated to:
  https://www.rebar3.org ([https](https://www.rebar3.org) result 200).
* http://code.google.com/p/clink/issues/detail?id=141 with 1 occurrences migrated to:
  https://code.google.com/p/clink/issues/detail?id=141 ([https](https://code.google.com/p/clink/issues/detail?id=141) result 301).
* http://contributor-covenant.org with 1 occurrences migrated to:
  https://contributor-covenant.org ([https](https://contributor-covenant.org) result 301).
* http://contributor-covenant.org/version/1/3/0/ with 1 occurrences migrated to:
  https://contributor-covenant.org/version/1/3/0/ ([https](https://contributor-covenant.org/version/1/3/0/) result 301).
* http://inaka.github.com/apns4erl with 1 occurrences migrated to:
  https://inaka.github.com/apns4erl ([https](https://inaka.github.com/apns4erl) result 301).
* http://inaka.github.com/edis/ with 1 occurrences migrated to:
  https://inaka.github.com/edis/ ([https](https://inaka.github.com/edis/) result 301).
* http://lasp-lang.org/ with 1 occurrences migrated to:
  https://lasp-lang.org/ ([https](https://lasp-lang.org/) result 301).
* http://msdn.microsoft.com/en-us/library/aa366778 with 1 occurrences migrated to:
  https://msdn.microsoft.com/en-us/library/aa366778 ([https](https://msdn.microsoft.com/en-us/library/aa366778) result 301).
* http://msdn.microsoft.com/en-us/library/bb540814 with 1 occurrences migrated to:
  https://msdn.microsoft.com/en-us/library/bb540814 ([https](https://msdn.microsoft.com/en-us/library/bb540814) result 301).
* http://rabbitmq.com/documentation.html with 1 occurrences migrated to:
  https://rabbitmq.com/documentation.html ([https](https://rabbitmq.com/documentation.html) result 301).
* http://saleyn.github.com/erlexec with 1 occurrences migrated to:
  https://saleyn.github.com/erlexec ([https](https://saleyn.github.com/erlexec) result 301).
* http://www.erlang.org/doc/system_principles/versions.html with 1 occurrences migrated to:
  https://www.erlang.org/doc/system_principles/versions.html ([https](https://www.erlang.org/doc/system_principles/versions.html) result 301).
* http://www.mozilla.org/MPL/ with 66 occurrences migrated to:
  https://www.mozilla.org/MPL/ ([https](https://www.mozilla.org/MPL/) result 301).
* http://zhongwencool.github.io/observer_cli with 1 occurrences migrated to:
  https://zhongwencool.github.io/observer_cli ([https](https://zhongwencool.github.io/observer_cli) result 301).
2019-03-20 03:13:48 -05:00
Michael Klishin 9f6d2b449f Require Erlang 21.3 2019-03-20 10:24:51 +03:00
Loïc Hoguin 944f0087bf Make rabbit_pbe work for OTP-22 2019-03-19 15:02:24 +01:00
Jean-Sébastien Pédron 3eb5ae110a rabbitmq-hexpm.mk: Switch to hexpm-cli 0.3.0
This version should work with the latest `rebar3_hex` plugin (6.5.0).
2019-03-18 13:40:25 +01:00
Jean-Sébastien Pédron 844c591027 Revert "rabbitmq-run.mk: Increase lager message rate threshold from 50 to 5000"
We don't need this anymore, now that the high watermark is bumped
automatically when the log level is set to `debug` in rabbit_lager.

This reverts commit 49956c6423.
2019-03-18 11:41:28 +01:00
Michael Klishin 80c867763d Recon 2.4.0
[#164450566]
2019-03-15 05:32:16 +03:00
Michael Klishin cdf2a5afc0 Lager 3.6.9
[#164603900]
2019-03-15 05:17:19 +03:00
kjnilsson 1e6fed8e4e Replace use of erl_call with rabbitmqctl
The stop-node command is the only make target still using erl_call who
is prone to breakage (broken in OTP 21.3) and can readily be replaced
with rabbitmqctl stop.
2019-03-14 15:26:24 +00:00
Jean-Sébastien Pédron 517e1ff45c rabbit_pretty_stdout: Honor the `UseColors` flag in `*_table()`
To fix this, introduce a new helper, `ascii_color/2`, which takes a the
same flag (`UseColors`) as its second argument. If that flag is false,
it returns an empty string.

While here, move the `isatty()` function in this module.
2019-03-01 15:53:56 +01:00
Jean-Sébastien Pédron d216e67183 rabbitmq-run.mk: Set `$LEAVE_PLUGINS_DISABLED` to start broker without plugins
I.e, plugins are available but left disabled at broker start. It is
still possible to enable them using rabbitmq-plugins(1).
2019-03-01 15:52:38 +01:00
Jean-Sébastien Pédron ef6aa904c9 rabbitmq-run.mk: Allow to set `$RABBITMQ_PLUGINS_DIR` when starting a broker 2019-03-01 15:50:14 +01:00
Loïc Hoguin 9501caaf12 Fix rabbit_pbe for OTP-22
Some new ciphers have been added. Others will be added once
crypto exposes an interface to get cipher information.
2019-02-27 17:07:42 +01:00
Michael Klishin d8079705e2 Introduce rabbit_runtime:gc_all_processes/0 2019-02-21 19:10:57 +03:00
Michael Klishin 6736eb3629 Try to make node name mismatch message clearer, provide a hint
Per recent rabbitmq-users feedback.
2019-02-20 01:27:30 +03:00
Michael Klishin a14097173b Fix a typo in rabbitmq-components.mk 2019-02-12 22:34:01 +03:00
Michael Klishin dce6094507 Merge branch 'spelling' of https://github.com/jsoref/rabbitmq-common into jsoref-spelling 2019-02-12 22:33:25 +03:00
Daniil Fedotov 1dfb335217 Bump erlang version requirement.
RabbitMQ depends on `ra`, which uses persistent_term, only available in 21.2
2019-02-12 10:26:38 -05:00
Josh Soref 75d372c427 spelling: synchronization 2019-02-12 00:21:44 -05:00
Josh Soref 3874970790 spelling: subsequently 2019-02-12 00:21:30 -05:00
Josh Soref 2b33b0bb30 spelling: significant 2019-02-12 00:20:34 -05:00
Josh Soref 808cd4584b spelling: requests 2019-02-12 00:18:15 -05:00
Josh Soref 4a6db60311 spelling: registered 2019-02-12 00:17:40 -05:00
Josh Soref a86a748ae7 spelling: protocol 2019-02-12 00:16:34 -05:00
Josh Soref cceee735c3 spelling: originally 2019-02-12 00:15:43 -05:00
Josh Soref 5fd7ff1b9b spelling: occurring 2019-02-12 00:00:36 -05:00
Josh Soref 41d90889f9 spelling: messages 2019-02-12 00:14:01 -05:00
Josh Soref d741ee8630 spelling: javascript 2019-02-12 00:12:43 -05:00
Josh Soref c094d03324 spelling: implicitly 2019-02-12 00:11:55 -05:00
Josh Soref 5c9d996190 spelling: grammar 2019-02-12 00:10:49 -05:00
Josh Soref bf0b7560ed spelling: function 2019-02-12 00:09:37 -05:00
Josh Soref cf4be045c1 spelling: explicitly 2019-02-12 00:08:51 -05:00