Commit Graph

1921 Commits

Author SHA1 Message Date
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
Josh Soref eeb4f2150f spelling: during 2019-02-12 00:07:18 -05:00
Josh Soref 7bdd37a393 spelling: chosen 2019-02-12 00:04:24 -05:00
Josh Soref dc8988d366 spelling: asynchronous 2019-02-12 00:02:25 -05:00
Josh Soref fe1f2a3250 spelling: aggregator 2019-02-12 00:01:34 -05:00
Josh Soref f01c794511 spelling: additional 2019-02-12 00:01:01 -05:00
Michael Klishin 49a57986cd Merge pull request #301 from Haster2004/add-lager-sink-for-ldap
Add lager sink for ldap
2019-02-08 04:44:30 +03:00
Yury.Alioshinov a3d44e3fe4 fix whitespaces 2019-02-08 01:51:20 +03:00
Yury.Alioshinov 0e1e260446 rabbit_log_ldap external sink was added 2019-02-08 01:42:11 +03:00
Arnaud Cogoluègnes c8726cf2ac Handle empty binary payload when delivering message
Fixes #299
2019-02-07 14:47:50 +01:00
Loïc Hoguin a1b8b8fbbc Fix many Dialyzer warnings 2019-02-05 16:31:14 +01:00
kjnilsson 5d8cfdc134 Rename rabbit_log_ra
and add new sink to rabbitmq-build.mk

[#163724857]
2019-02-05 11:52:28 +00:00
Jean-Sébastien Pédron 9613cfafe0 Fix errors reported by Dialyzer
In particular, we drop support for Erlang R13B and older in
`rabbit_cert_info`. This fixes an error reported by Dialyzer now that
the list of dependencies (`$(LOCAL_DEPS)`) is more correct.
2019-02-01 10:45:30 +01:00
Jean-Sébastien Pédron 16d171c26d Makefile: Add missing dependencies to `$(LOCAL_DEPS)`
Dialyzer reports less missing types and unknown functions.
2019-02-01 10:45:29 +01:00
Jean-Sébastien Pédron 49956c6423 rabbitmq-run.mk: Increase lager message rate threshold from 50 to 5000
Otherwise, it drops too many messages and the log file becomes useless
when debugging.
2019-02-01 10:45:29 +01:00
Jean-Sébastien Pédron 43e40f3370 rabbitmq-run.mk: Log debug messages when using `make run-broker` 2019-02-01 10:45:29 +01:00
Jean-Sébastien Pédron dca9cad83a rabbitmq-run.mk: Configure `$RABBITMQ_FEATURE_FLAGS`
[#159298729]
2019-02-01 10:45:29 +01:00
Jean-Sébastien Pédron b4c944c880 rabbit_misc: Consider 3.7.x and 3.8.x+ compatible
... in version_minor_equivalent().

Note that we'll need a special case to exclude 3.7.x versions which
don't have the feature flags modules.

At the same time, we introduce the `strict_version_minor_equivalent()`
function which has the behavior the initial function had before. This is
used in the context of plugin compatibility checks: plugins can specify
a `broker_version_requirements` property and at this point, plugins
compatible with 3.7.x should not be considered as compatible with 3.8.x.

[#159298729]
2019-02-01 10:45:29 +01:00
Jean-Sébastien Pédron 01ef2d29dd Make #amqqueue{} a private record
See the corresponding commit in rabbitmq-server for all the
explanations.

Now, all accesses to the #amqqueue{} record are made through the
`amqqueue` module (available in rabbitmq-server). The new type name is
`amqqueue:amqqueue()`.

The `amqqueue.hrl` header also provides some macros to help with pattern
matching and guard expressions.

To help with this, code and modules were moved from rabbitmq-common to
rabbitmq-server.

[#159298729]
2019-02-01 10:45:29 +01:00
Jean-Sébastien Pédron 00ce6ffdf8 rabbit_pretty_stdout: New module to pretty-print a table
It supports ANSI colors and line drawing.
2019-02-01 10:45:25 +01:00
kjnilsson 881ebd1e02 fix dialyzer error 2019-01-31 14:58:18 +00:00
kjnilsson a9430e5d6e Add rabbit_log_ra shim
And make a new logging category for Ra logs

[#163518117]
2019-01-30 13:03:42 +00:00
Arnaud Cogoluègnes 7a624fec9b Add activity status field to consumer created
[#163298456]

References rabbitmq/rabbitmq-server#1838
2019-01-28 17:22:21 +01:00
Karl Nilsson d89ebb57c1 Merge pull request #292 from rabbitmq/rabbitmq-management-649-single-active-consumer
Integrate single active consumer with metrics
2019-01-17 10:53:16 +00:00
Michael Klishin 26cca70307 Merge pull request #294 from rabbitmq/mk-heartbeat-timeout-type-specs
Introduce a new type, heartbeat_timeout, for documentation purposes
2019-01-16 04:14:16 +03:00
Michael Klishin 1da03bf38a Use heartbeat_timeout/0 in more places 2019-01-16 04:04:10 +03:00
Michael Klishin 2704b40804 Introduce a new type, heartbeat_timeout, for documentation purposes
Per discussion with @lukebakken.
2019-01-16 04:01:21 +03:00
Luke Bakken 39bbe89259 Debug the start of heartbeat senders 2019-01-15 16:22:20 -08:00
Arnaud Cogoluègnes 74c57aced8 Integrate single active consumer with metrics
* Add single active consumer flag in consumer metrics
 * Add function to update consumer metrics when a consumer is promoted
to single active consumer

[#163089472]

References rabbitmq/rabbitmq-management#649
2019-01-15 15:15:45 +01:00
Michael Klishin 0e8d48fc70 Bump (c) year in startup banner
References rabbitmq/rabbitmq-server#1830.
2019-01-14 01:33:03 +03:00
Michael Klishin ce47d85a93 Update rabbitmq-components.mk 2019-01-10 02:08:44 +03:00
Michael Klishin 38858e62b3 Merge pull request #288 from rabbitmq/rabbitmq-server-1799-single-active-consumer-in-qq
Single active consumer in quorum queue
2019-01-09 03:03:34 +03:00
Michael Klishin bf8ac8f262 Merge branch 'master' into rabbitmq-server-1799-single-active-consumer-in-qq 2019-01-08 23:23:45 +03:00
Luke Bakken c0a2e3baec Merge branch 'rabbitmq-server-952' 2019-01-08 11:31:40 -08:00
Jean-Sébastien Pédron cbe3cc9ccc Travis CI: Use Ubuntu Xenial image
It comes with Elixir 1.7.4, therefore we don't need to install Elixir
from a Debian package.
2019-01-08 12:46:40 +01:00
Jean-Sébastien Pédron df6bb46b90 Travis CI: Test against Erlang 21.2 only
This is the minimum requirement in `master`.
2019-01-08 09:01:57 +01:00
Jean-Sébastien Pédron e1e76f25b3 Travis CI: Use Elixir 1.6.6 2019-01-08 09:01:37 +01:00
Jean-Sébastien Pédron c3628055ab Makefile: Remove the Hex.pm `maintainers` field from .app
It is now deprecated by Hex.pm.
2019-01-08 08:57:51 +01:00
Luke Bakken e33487ab63 Add sysmon_handler dependency
Fixes rabbitmq/rabbitmq-server#952
2019-01-07 12:52:06 -08:00
Michael Klishin 8fb32bd259 Be more defensive when requesting connection parameters
References #1538.
2019-01-02 14:05:36 +03:00
Michael Klishin e29005d617 Wording 2019-01-02 02:58:10 +03:00
Daniil Fedotov e7cce3b95d Reduce max message size to 512MB. 2018-12-27 19:24:57 +04:00
Arnaud Cogoluègnes 0b8841ad51 Merge branch 'master' into rabbitmq-server-1799-single-active-consumer-in-qq 2018-12-14 14:11:50 +01:00
Loïc Hoguin bf9e786749 Remove a macro related to the removed truncate module 2018-12-11 17:04:30 +01:00
Arnaud Cogoluègnes 0613d10a08 Merge branch 'master' into rabbitmq-server-1743-exclusive-consumer 2018-12-11 17:03:57 +01:00
Michael Klishin d8f5c2da24 Stop microstate accounting after sampling 2018-12-07 18:42:29 +03:00
Michael Klishin 723d1494e9 Merge branch 'master' into msacc-command 2018-12-07 15:39:51 +03:00
Jean-Sébastien Pédron 2d116f96d6 rabbitmq-hexpm.mk: Switch to hexpm-cli 0.2.0
This version should work with the latest `rebar3_hex` plugin.
2018-12-06 18:32:53 +01:00
Michael Klishin 733bcb6507 rabbitmq-components.mk: remove SockJS, rabbitmq_clusterer, rabbitmq_management_visualiser
They've been discontinued in 3.7.0.
2018-12-06 18:27:46 +03:00
Michael Klishin 1738b0aefa Merge branch 'master' into msacc-command 2018-12-05 21:52:14 +03:00
Michael Klishin 7c3d347b14 Introduce rabbit_runtime 2018-12-05 21:51:43 +03:00
Michael Klishin 05e721d1cb Support rabbit_proxy_socket tuples in rabbit_net:getstat/2
References #279.
2018-12-05 20:31:51 +03:00
Michael Klishin 93ff47fbbd Merge branch 'master' into ranch_proxy_header 2018-12-05 15:04:24 +03:00
Michael Klishin 56a4741b38 Merge pull request #283 from noxdafox/master
rabbit_backing_queue: extend is_duplicate callback return values
2018-12-05 00:04:00 +03:00
Loïc Hoguin ed7802233d Use the built-in Ranch PROXY protocol support 2018-12-04 12:29:29 +01:00
Loïc Hoguin ea18cd032b Update Ranch to 1.7.1 and Cowboy to 2.6.1 2018-11-28 15:53:03 +01:00
Matteo Cafasso 7cfb017889 rabbit_backing_queue: extend is_duplicate callback return values
Allow the backing queue implementation to inform the amqqueue process
how to proceed when a message duplicate is encountered.

 * {true, drop} the message is a duplicate and should be ignored
 * {true, reject} the message is a duplicate and the publisher should
   receive a rejection
 * false the message is not deemed a duplicate
 * true kept for backward compatibility, equivalent to {true, drop}

Signed-off-by: Matteo Cafasso <noxdafox@gmail.com>
2018-11-23 23:01:33 +02:00
Arnaud Cogoluègnes 8fa1ba43f0 Merge branch 'master' into rabbitmq-server-1743-exclusive-consumer 2018-11-22 09:35:07 +01:00
Loïc Hoguin 3a9b2134c4 Update Cowboy to 2.6 and Ranch to 1.7 2018-11-20 14:34:59 +01:00
John Eckersberg 69b4d311da rabbitmq-run.mk: Fix stop-brokers with NODES > 1
The seq command should include a -1 increment to stop nodes in reverse
order.  Previously, as an example with NODES=2, will run `seq 2 1`
which produces no items to iterate, so the entire stop-node loop does
not execute and the brokers are left running.
2018-11-16 08:52:59 -05:00
Jean-Sébastien Pédron ecc8c4e670 rabbitmq-run.mk: Add AMQP and management TCP ports to `test_rabbitmq_config`
This helps when we want to start multiple nodes on the same host with
the management plugin enabled.
2018-11-05 14:16:12 +01:00
kjnilsson 7242b2f98b add Ra as external dependency 2018-10-29 12:41:41 +00:00
Karl Nilsson c18bcb27e1 Merge pull request #274 from rabbitmq/quorum-queue
Quorum queue
2018-10-29 09:45:31 +00:00
Arnaud Cogoluègnes b204adab45 Add member/2 to priority_queue module
To check whether a value is in the queue or not. Handle both
non-priority and priority queue. Based on lists:member/2, does not take
into account the priority of the value in the queue to check equality.

References rabbitmq/rabbitmq-server#1743
2018-10-24 16:06:51 +02:00
Luke Bakken 1838b50277 Update socket stats after running handler
When a heartbeat handler is run, the socket stats should be re-collected because the act of running the handler can affect the stats (like sent bytes).

See https://groups.google.com/d/topic/rabbitmq-users/djNpSuQoznY/discussion
2018-10-22 19:39:20 -07:00
kjnilsson 0918ca4a22 remove created_at from amqqueue record 2018-10-19 16:33:38 +01:00
kjnilsson 97a17ec55a modernise pmon 2018-10-18 15:12:10 +01:00
Loïc Hoguin 4c40b6adf9 Remove dependency on erlang-src
It has been reported that in order to use the Erlang client, the
Erlang/OTP source must be available. This is due to one include
file that rabbit_net required. This dependency has been removed.

Instead of calling is_record(sslsocket) the macro ?IS_SSL will
now perform the same test manually (check that it is a tuple,
that the size is correct and that the first element equals sslsocket).

The tuple has not changed in a very long time so doing this
manually is at least as safe as including this private header
file (it could be removed or moved at any time).

Once Erlang/OTP 22 gets out and we know how sockets will be
represented with the NIF implementation, we could revise this
and check whether the socket is one that gen_tcp accepts
(currently it's a port, but this will probably change when
a NIF is used).
2018-10-17 12:30:13 +01:00
Diana Corbacho 5fd7888b8a Increase queue churn metrics when queues are deleted in bulk by node down
[#160943831]
2018-10-17 12:30:13 +01:00
Diana Corbacho d21b745d08 New connection churn metrics table
Rate metrics for monitoring of high connection churn scenarios
[#160943831]
2018-10-17 12:30:13 +01:00
Jean-Sébastien Pédron 8e0d0a0a2e include/rabbit.hrl: Bump Erlang requirement to 21.0
With the quorum queue code, RabbitMQ probably still works with Erlang
20.x, but it is not thoroughly tested. Thus, bump the requirement to
Erlang 21.0.
2018-10-11 12:36:40 +02:00
Michael Klishin 26492f4925 Merge pull request #277 from rabbitmq/rabbitmq-server-1723
Report connection/channel/queue churn
2018-10-11 02:16:55 +03:00
Loïc Hoguin adeffe8ad4 Remove dependency on erlang-src
It has been reported that in order to use the Erlang client, the
Erlang/OTP source must be available. This is due to one include
file that rabbit_net required. This dependency has been removed.

Instead of calling is_record(sslsocket) the macro ?IS_SSL will
now perform the same test manually (check that it is a tuple,
that the size is correct and that the first element equals sslsocket).

The tuple has not changed in a very long time so doing this
manually is at least as safe as including this private header
file (it could be removed or moved at any time).

Once Erlang/OTP 22 gets out and we know how sockets will be
represented with the NIF implementation, we could revise this
and check whether the socket is one that gen_tcp accepts
(currently it's a port, but this will probably change when
a NIF is used).
2018-10-09 14:48:25 +02:00
Diana Corbacho 38280262eb Increase queue churn metrics when queues are deleted in bulk by node down
[#160943831]
2018-10-09 13:16:02 +01:00
Diana Corbacho ac62721854 New connection churn metrics table
Rate metrics for monitoring of high connection churn scenarios
[#160943831]
2018-10-08 15:02:16 +01:00
Luke Bakken 02cc25124d Merge branch 'master' into quorum-queue 2018-09-28 11:45:27 -07:00
Luke Bakken 9e421db16c rabbit_pbe: re-format NotSupportedByUs list 2018-09-28 11:43:46 -07:00
Luke Bakken 3c0d95e641 rabbit_pbe: add function clauses to match sha3 hashes 2018-09-28 11:05:54 -07:00
kjnilsson 8a7441cbca Add a few applications to PLT_APPS 2018-09-28 12:59:02 +01:00
Luke Bakken d89a166a02 Improve error case if erl / erl.exe is not in PATH
Improves rabbitmq/rabbitmq-server#1654

Reported via:

https://groups.google.com/d/msg/rabbitmq-users/YgtY4R_heI0/AZFs5RPTCgAJ

VESC-906
2018-09-27 12:26:41 -07:00
Michael Klishin cbb7c38a13 Merge branch 'master' into get-empty-stats 2018-09-21 14:13:23 +02:00
Diana Corbacho f7bb8baff3 Revert "Configure ra metrics handler"
This reverts commit 1d946c91635f250677968949d79abd5b40974201.
2018-09-21 08:51:16 +01:00
Diana Corbacho baadbe8701 Configure ra metrics handler
[#157193081]
2018-09-21 08:51:16 +01:00
kjnilsson 8ce0dd6fb2 remove quorum_mapping table 2018-09-21 08:51:16 +01:00
Diana Corbacho dd82830642 Export block/unblock for flow control
[#157000583]
2018-09-21 08:51:16 +01:00
kjnilsson f76039d3da dialyzer fix 2018-09-21 08:51:16 +01:00
Diana Corbacho 5ee1757551 Revert "Add quorum_leader to amqqueue record"
This reverts commit 7eff8a551426c03725f30db8516150c1c2c127b2.
2018-09-21 08:51:16 +01:00
Diana Corbacho 4cac30b209 Add quorum_leader to amqqueue record
[#154472407]
2018-09-21 08:51:16 +01:00
Diana Corbacho 3a5e9b99a1 Add quorum_nodes to amqqueue record
[#154472231]
2018-09-21 08:51:16 +01:00
Diana Corbacho 978d7747c0 Add created_at field to amqqueue record
[#155458625]
2018-09-21 08:51:16 +01:00
Daniil Fedotov f6d18f8247 Revert Revert "Extend amqqueue record to include queue type" 2018-09-21 08:51:16 +01:00
Diana Corbacho d145becaee Use RABBITMQ_QUORUM_DIR as ra data_dir when starting a node
[#154472152]
2018-09-21 08:51:16 +01:00
Diana Corbacho a31a8329fe Create quorum_mapping table to obtain queue name from a ra id
[#154472241]
2018-09-21 08:51:16 +01:00
Diana Corbacho 3e66da916c Set the ra data_dir when starting a node
Ra is now a dependency of rabbit application, and it must be started
and configured on every rabbitmq node

[#154472152]
2018-09-21 08:51:16 +01:00
Jean-Sébastien Pédron 63661e083b rabbit_pbe: Mark AES-CCM as unsupported
This seems to be a new cipher in Erlang 22.
2018-09-19 15:40:21 +02:00
Jean-Sébastien Pédron 26cd7e4980 rabbitmq-components.mk: Bump Ranch to 1.6.2
... and ranch_proxy_protocol to 2.1.1.

Ranch 1.6.2 fixes ninenines/ranch#205 which was discovered in the
rabbitmq-stomp testsuite.

[#160270896]
2018-09-19 11:00:56 +02:00
Diana Corbacho 269434f322 Add basic.get_empty stats
The delivery stats tuple has now one more element
[#160280626]
2018-09-17 11:25:27 +01:00
Jean-Sébastien Pédron 54ddd93df5 rabbit_pbe: Mark ChaCha20 as unsupported
This seems to be a new cipher in Erlang 22.
2018-09-11 14:32:00 +02:00
Jean-Sébastien Pédron 158d07485b rabbitmq-components.mk: Bump 3rd-party dependencies' pinning
* Lager: 3.6.4 -> 3.6.5
* Ranch: 1.5.0 -> 1.6.1
* ranch_proxy_protocol: 1.5.0 -> 2.1.0-rc.1

Note that ranch_proxy_protocol 2.1.0-rc.1 is not an official release
from upstream: it was published by us (the RabbitMQ team) because we
don't have feedback from upstream about a pull request to update Ranch
to 1.6.x (heroku/ranch_proxy_protocol#49). Hopefully upstream will merge
the pull request and cut a new official release.

Fixes rabbitmq/rabbitmq-common#269.
[#160270896]
2018-09-11 14:25:16 +02:00
Daniil Fedotov 58d955fe33 Make dialyzer ignore missing gen_event:start_link/2 2018-08-21 12:52:32 +01:00
Daniil Fedotov 8f6c838a42 Remove -Wunmatched_returns from default dialyzer options. 2018-08-14 17:34:19 +01:00
Jean-Sébastien Pédron a52cd02bff rabbitmq-components.mk: Switch back to Ranch 1.5.0
... until we have a compatible ranch_proxy_protocol.
2018-08-09 17:43:24 +02:00
Jean-Sébastien Pédron b97303820c rabbitmq-components.mk: Bump 3rd-party dependencies' pinning
* Cowboy: 2.3.0 -> 2.4.0
* Cowlib: 2.2.1 -> 2.3.0
* Lager: 3.6.3 -> 3.6.4
* Ranch: 1.5.0 -> 1.6.0
* Recon: 2.3.4 -> 2.3.6

`ranch_proxy_protocol` was not updated to 2.0.0 because it drops support
for Erlang 19.3 (it requires `ssl:handlshake()`).
2018-08-09 12:06:51 +02:00
Daniil Fedotov f4210ed6d1 Make rabbit_event:notify NOT fail if rabbit_event is not started yet.
If resource alarm is triggered during the boot process it will send
an event via rabbit_event:notify. This can crash the node if rabbit_event
is not started yet. rabbit_event starts after rabbit_alarm and any alarms
on boot were crashing the node.

Calling gen_event:notify with {rabbit_event, node()} is the same as with
rabbit_event except it does not fail.
2018-07-17 17:19:50 +01:00
Michael Klishin e0491ce245 Pass authentication context to Mod:user_login_authorization/2
Part of rabbitmq/rabbitmq-server#1633.

[#158805410]
2018-07-03 23:29:43 +03:00
Jean-Sébastien Pédron 0312c6c5ed rabbirmq-run.mk: Use rabbitmqctl(1) instead of erl_call(1)
erl_call(1) is broken in Erlang 21.0-rc.2 when we use it to evaluate
some code on a remote node. The issue was reported upstream but we can
replace erl_call(1) by `rabbitmqctl eval` to achieve the same result.

The output is still filtered using sed(1) to ensure it remains
unchanged, in case testsuites expect a particular format.

We still continue to use erl_call(1) to stop a node because we can't
achieve the same behavior using rabbitmqctl(1). This use of erl_call(1)
is working with Erlang 21.0-rc.2.

[#157964874]
2018-06-07 11:38:44 +02:00
Jean-Sébastien Pédron 80db0f7e7d rabbit_pbe: Mark ChaCha20-Poly1305 as unsupported
[#157964874]
2018-06-07 11:38:43 +02:00
Michael Klishin 69814cf194 Compile Erlang/OTP 21
OTP 21 deprecated erlang:get_stacktrace/0 in favor of a new
try/catch syntax. Unfortunately that's not realistic for projects
that support multiple Erlang versions (like us) until OTP 21 can be
the minimum version requirement. In order to compile we have to ignore
the warning. The broad compiler option seems to be the most common
way to support compilation on multiple OTP versions with warnings_as_errors.

[#157964874]
2018-06-07 11:38:40 +02:00
Jean-Sébastien Pédron a993a4ab1b rabbitmq-components.mk: Update lager to 3.6.3
This version is the first one compatible with Erlang 21.x.

[#157964874]
2018-06-07 11:13:04 +02:00
Michael Klishin 03e8eac523 Handle file descriptor (I/O) stats as returned by OTP 21
Pairs: @dumbbell @dcorbacho.

[#157964874]

(cherry picked from commit 502f8c35fbc8cd882120878c543d351e7a7a6787)
2018-06-06 17:40:09 +03:00
Michael Klishin 2894a9489a Introduce MAX_SUPPORTED_PRIORITY
Part of rabbitmq/rabbitmq-server#1590.

[#157380396]
2018-05-10 21:54:03 -05:00
Michael Klishin 752254d92d rabbit_misc:pget/{2,3}: support maps
References rabbitmq/rabbitmq-federation#67, rabbitmq/rabbitmq-federation#70,
rabbitmq/rabbitmq-federation#73, rabbitmq/rabbitmq-federation#75.
2018-04-30 17:47:46 -05:00
Michael Klishin 9cac2b1337 rabbit_misc:pget/{2,3}: move spec to the defition, use modern list type signature 2018-04-30 11:34:32 -05:00
Michael Klishin 552af3f3bf Export rabbit_net:hostname/0
References rabbitmq/rabbitmq-server#1580.
2018-04-20 22:24:25 +09:00
Jean-Sébastien Pédron d9f23c1f8d rabbitmq-tools.mk: New targets to print Git repoository URLs
They are useful to query the upstream/default Git repository URLs for
both fetch and push.

[#156874375]
2018-04-18 11:43:35 +02:00
Jean-Sébastien Pédron 11cd0cd8a0 Update erlang.mk 2018-04-11 10:52:24 +02:00
Jean-Sébastien Pédron 99e9a354df rabbitmq-components.mk: Update other third-party dependencies
* Cowboy: 2.2.2 -> 2.3.0
* Cowlib: 2.1.0 -> 2.2.1
* jsx:    2.8.2 -> 2.9.0
* Lager:  3.5.1 -> 3.6.1
* recon:  2.3.2 -> 2.3.4
2018-04-11 10:44:25 +02:00
Jean-Sébastien Pédron bcb92df7a1 rabbitmq-components.mk: Update Ranch to 1.5.0
... as well as ranch_proxy_protocol to 1.5.0.
2018-04-11 10:03:49 +02:00
Jean-Sébastien Pédron 484be7d46f Travis CI: Ensure Elixir 1.6.0 is installed
We were installing the correct version but the check was not updated and
was still expecting version 1.4.5.
2018-04-09 12:02:10 +02:00
Jean-Sébastien Pédron 6db010391c Travis CI: Install Elixir 1.6.0
... instead of Elixir 1.4.5.
2018-04-09 11:54:35 +02:00
Jean-Sébastien Pédron 483aec8a4d rabbit_event: Add `gen_event:start_link/2` to `-ignore_xref()`
The code already verifies that `gen_event:start_link/2` is available
before calling it, and falls back on `gen_event:start_link/1`
appropriately.

Therefore we can add it to the `-ignore_xref()` list to fix the xref
check.
2018-04-09 09:49:58 +02:00
Michael Klishin a4d7e6c82c Export the new function 2018-04-06 08:29:24 +08:00
Michael Klishin 8a9d8e585d Merge branch 'master' into reduce-mnesia-contention-when-nodes-restart-master
Conflicts:
	src/rabbit_core_metrics.erl
	src/rabbit_event.erl
2018-04-06 08:28:55 +08:00
Michael Klishin 2d4018b550 Merge branch 'reduce-mnesia-contention-when-nodes-restart-v3.7.x' into reduce-mnesia-contention-when-nodes-restart-master
Conflicts:
	src/rabbit_core_metrics.erl
	src/rabbit_event.erl
2018-04-05 09:51:26 +08:00
Gerhard Lazu 23df30af00 Fix Erlang 19.3 support
gen_event:start_link/2 is not available before Erlang 20. RabbitMQ
3.7 needs to support Erlang 19.3 and above.

We thought of implementing different garbage collection strategies for
rabbit_event that would be compatible with Erlang 19.3, but failed
because gen_event is a special type of process:

* fullsweep_after cannot be set via process flag, it returns a badarg
  exception
* collecting on a timer would be weird because all the handlers would
  receive the event
* we can't force a full GC via hibernating, because this would need to
  run after each event, which would result in terrible performance

Partner-in-crime: @essen
2018-04-03 12:31:18 +01:00
Gerhard Lazu 85ba45a8ab Use ETS operations that are available in Erlang 19.3
ets:select_replace/2 is only available in Erlang 20 and above. RabbitMQ
3.7 needs to support Erlang 19.3 and above.

We haven't noticed any difference in performance when using one approach
over the other.

To keep the code simple, we decided to not detect which approach to use.

Partern-in-crime: @essen
2018-04-03 12:28:06 +01:00
Michael Klishin ffe132d823 Revert "Delete metrics for all deleted queues in 4 ETS operations (master)" 2018-03-28 21:31:39 +03:00
Gerhard Lazu 00951fdde9 Always run a full GC on rabbit_event
When a node has to process events generated by creating 100k
connections, 100k channels & 50k queues, it was observed that this
process would use up to 13GB of memory and never release it.

Since we are running a full GC whenever GC runs, this will slow the
process down by ~10%, but the memory usage is stable & all memory gets
eventually released. On a busy system, this can amount to many GBs.

Partner-in-crime: @essen
2018-03-28 00:56:55 +03:00
Gerhard Lazu b04bc83b55 Build smaller match spec conditions rather than a single big one
Otherwise, we can trigger a stack overflow in the Erlang VM itself, as
described in ERL-592: https://bugs.erlang.org/browse/ERL-592

The code before works fine when 50k queues are being deleted out of 100k
queues, but fails when there are 150k queues in total & 50k need to be
deleted.

Partner-in-crime: @essen
2018-03-28 00:56:55 +03:00
Gerhard Lazu c391c0468f Delete metrics for all deleted queues in 4 ETS operations
Rather than using 6 ETS operations per deleted queue, build a match
spec that matches all queues & use ets:select_replace/2 to delete
metrics all queues in 4 super efficient ETS operations.

Great suggestions @michaelklishin & @hairyhum!
ee0951b1b3 (comments)

Notice that build_match_spec_conditions_to_delete_all_queues/1 is not
tail recursive, because it's more efficient this way due to the required
return value. The exact details elude me, @essen can answer this better
than I can.

Linked to rabbitmq/rabbitmq-server#1526

For initial context, see #1513

Partner-in-crime: @essen
2018-03-28 00:56:54 +03:00
Gerhard Lazu e04076d39a Always run a full GC on rabbit_event
When a node has to process events generated by creating 100k
connections, 100k channels & 50k queues, it was observed that this
process would use up to 13GB of memory and never release it.

Since we are running a full GC whenever GC runs, this will slow the
process down by ~10%, but the memory usage is stable & all memory gets
eventually released. On a busy system, this can amount to many GBs.

Partner-in-crime: @essen
2018-03-27 16:06:36 +01:00
Gerhard Lazu 78d13ffcf9 Build smaller match spec conditions rather than a single big one
Otherwise, we can trigger a stack overflow in the Erlang VM itself, as
described in ERL-592: https://bugs.erlang.org/browse/ERL-592

The code before works fine when 50k queues are being deleted out of 100k
queues, but fails when there are 150k queues in total & 50k need to be
deleted.

Partner-in-crime: @essen
2018-03-27 16:06:36 +01:00
Gerhard Lazu d90e357a5f Delete metrics for all deleted queues in 4 ETS operations
Rather than using 6 ETS operations per deleted queue, build a match
spec that matches all queues & use ets:select_replace/2 to delete
metrics all queues in 4 super efficient ETS operations.

Great suggestions @michaelklishin & @hairyhum!
ee0951b1b3 (comments)

Notice that build_match_spec_conditions_to_delete_all_queues/1 is not
tail recursive, because it's more efficient this way due to the required
return value. The exact details elude me, @essen can answer this better
than I can.

Linked to rabbitmq/rabbitmq-server#1526

For initial context, see #1513

Partner-in-crime: @essen
2018-03-27 16:06:35 +01:00
Jean-Sébastien Pédron f6534839a0 Travis CI: Test against Erlang 20.3 instead of 20.1 2018-03-26 17:34:09 +02:00
Jean-Sébastien Pédron 9dc474006b Travis CI: Don't send notifications for successful builds 2018-03-26 15:28:22 +02:00
Arnaud Cogoluègnes ab085c7dec Merge pull request #255 from rabbitmq/rabbitmq-server-1538-master
Merge rabbitmq-server-1538 to master
2018-03-14 15:36:24 +01:00
Arnaud Cogoluègnes f71878a3da Merge pull request #253 from rabbitmq/rabbitmq-server-1538
Check process before getting amqp_params
2018-03-14 15:35:15 +01:00
Jean-Sébastien Pédron b4b8c8057e rabbitmq-early-test.mk: Start common_test node with `-hidden`
That way, it doesn't interfere with testcases working with multiple
RabbitMQ nodes. Furthermore, independent sets of nodes won't try to
autoconnect to the common_test node, and thus unrelated nodes after.
This is useful for the upcoming VM-based test helpers.

[#153749132]

(cherry picked from commit 47a5bdfff548a5c278af2d947feeeb7836aae0c3)
2018-03-06 22:26:12 +03:00
Jean-Sébastien Pédron 343395d605 rabbit_misc:is_process_alive(): Consider hidden nodes
... while checking if we are connected to the given PID's node. This
fixes an issue where an Erlang client, connected directly to the
RabbitMQ node (as opposed to a TCP connection), is running an a hidden
Erlang node.

[#153749132]

(cherry picked from commit 48df58b63dc1157a9954fc5413aa027cb9552db8)
2018-03-06 22:26:03 +03:00
Jean-Sébastien Pédron ce23bfb8a9 rabbitmq-early-test.mk: Start common_test node with `-hidden`
That way, it doesn't interfere with testcases working with multiple
RabbitMQ nodes. Furthermore, independent sets of nodes won't try to
autoconnect to the common_test node, and thus unrelated nodes after.
This is useful for the upcoming VM-based test helpers.

[#153749132]

(cherry picked from commit 5c0546fb5bf9e7d61e90399373b11962011f548d)
2018-03-06 21:49:17 +03:00
Jean-Sébastien Pédron e848d51422 rabbit_misc:is_process_alive(): Consider hidden nodes
... while checking if we are connected to the given PID's node. This
fixes an issue where an Erlang client, connected directly to the
RabbitMQ node (as opposed to a TCP connection), is running an a hidden
Erlang node.

[#153749132]

(cherry picked from commit 66f5ae28ea993d761507dbd9034d59491f0d2bc6)
2018-03-06 21:49:06 +03:00
Luke Bakken d7d4fd7b8b Merge branch 'rabbitmq-server-1538' into rabbitmq-server-1538-master 2018-03-06 10:23:18 -08:00
Luke Bakken 04d4cd601e Check process before getting amqp_params
Fixes rabbitmq/rabbitmq-server#1538

Handle the bad_argument case from rabbit_reader
2018-03-06 10:12:56 -08:00
Jean-Sébastien Pédron e232a6080e Revert "rabbitmq-early-test.mk: Start common_test node with `-hidden`"
This reverts commit 878628a1f9.
2018-03-05 14:50:20 +01:00
Jean-Sébastien Pédron 18985a1007 Merge branch 'hide-common_test-node' 2018-03-05 12:25:22 +01:00
Jean-Sébastien Pédron 878628a1f9 rabbitmq-early-test.mk: Start common_test node with `-hidden`
That way, it doesn't interfere with testcases working with multiple
RabbitMQ nodes. Furthermore, independent sets of nodes won't try to
autoconnect to the common_test node, and thus unrelated nodes after.
This is useful for the upcoming VM-based test helpers.

[#153749132]
2018-03-05 12:23:21 +01:00
Jean-Sébastien Pédron faea76a8bd Update erlang.mk 2018-03-02 19:03:13 +01:00
Jean-Sébastien Pédron 02c35a07f9 Update erlang.mk 2018-03-02 18:35:21 +01:00
Jean-Sébastien Pédron c969f3756f Update erlang.mk 2018-03-02 18:29:48 +01:00
Michael Klishin b68cd5e2b3 Handle {ongoing_change_to, NewValue} responses from net_kernel:set_net_ticktime/2
See rabbitmq/rabbitmq-server#1524 and rabbitmq/rabbitmq-server#1522 for details.

(cherry picked from commit 75e2f71562)
2018-02-23 00:34:16 +03:00
Michael Klishin 75e2f71562 Handle {ongoing_change_to, NewValue} responses from net_kernel:set_net_ticktime/2
See rabbitmq/rabbitmq-server#1524 and rabbitmq/rabbitmq-server#1522 for details.
2018-02-22 20:14:35 +03:00
Jean-Sébastien Pédron b0ef541275 Merge branch 'fix-dialyzer-errors-part2' 2018-02-02 10:24:05 +01:00
Jean-Sébastien Pédron 7be4181672 rabbit_net: Ignore Dialyzer warnings in socket_ends() and unwrap_socket()
Those functions are currently looking into opaque types from
`ranch_proxy_protocol`. Until this is fixed, we just ignore the warnings
and comment out the specs.

[#153850881]
2018-02-01 17:18:45 +01:00
Jean-Sébastien Pédron a323a8a94c Explicitly ignore return values we don't care about
These warnings were reported by Dialyzer.

[#153850881]
2018-02-01 17:13:02 +01:00
Jean-Sébastien Pédron 6670fd94f3 lager_forwarder_backend: Fix spec of #state{}
It was missing the 'inherit' value of the `level` member.

The warning was reported by Dialyzer.

[#153850881]
2018-02-01 17:11:55 +01:00
Jean-Sébastien Pédron 3be47d477e rabbitmq-build.mk: Only add rabbitmq-cli to compiler path for plugins
rabbitmq-common shouldn't see this, otherwise it's a reverse dependency
and thus a dependency circle.

In the future, we should fix this by adding rabbitmq-cli as an explicit
dependency to whatever component needs it.

[#153850881]
2018-02-01 17:09:26 +01:00
Jean-Sébastien Pédron fa3c5c9ea0 Merge branch 'fix-dialyzer-errors' into v3.7.x 2018-02-01 16:21:48 +01:00
Jean-Sébastien Pédron b8cce2ad54 Merge branch 'fix-dialyzer-errors' into fix-dialyzer-errors-in-master 2018-02-01 13:19:35 +01:00
Jean-Sébastien Pédron 570354013a vm_memory_monitor: Fix spec of get_cached_process_memory_and_limit()
The second element of the tuple either a float or 'infinity', never an
integer.

The warning was reported by Dialyzer.

[#153850881]
2018-02-01 13:17:00 +01:00
Jean-Sébastien Pédron f6377842a9 gen_server2: Document that terminate() doesn't return
While here, silence the same warning for do_multi_call() because it
comes from an anonymous function. We could move the anonymous function
to a regular function and give it a spec. However, we prefer to keep the
diff with upstream small.

[#153850881]
2018-02-01 13:17:00 +01:00
Jean-Sébastien Pédron c2ee056d06 rabbit_core_metrics: Fix return values of several functions
They were returning `true` (the return value of ets:insert() or
ets:delete()), whereas many others were returning `ok`. So make them
return `ok` for consistency's sake. Furthermore it matches their
specification.

These warnings were reported by Dialyzer.

[#153850881]
2018-02-01 13:16:59 +01:00
Jean-Sébastien Pédron f462be8d9f rabbit_log: Document that handle_damaged_io_system() doesn't return
The warning was reported by Dialyzer.

[#153850881]
2018-02-01 13:16:59 +01:00
Jean-Sébastien Pédron 36598fc8b2 rabbit_misc: Fix specs of rpc_call() and get_gc_info()
These warnings were reported by Dialyzer().

[#153850881]
2018-02-01 13:16:59 +01:00
Jean-Sébastien Pédron 1032d8551c rabbit_heartbeat, rabbit_writer: system_terminate() doesn't return
Thus, use the correct return type of `no_return()`. Even if it's defined
as `none()` according to the documentation, it doesn't have the same
semantic.

The warning was reported by Dialyzer.

[#153850881]
2018-02-01 13:16:59 +01:00
Jean-Sébastien Pédron 55a794d357 supervisor2: #state.dynamics can be 'undefined'
The warning was reported by Dialyzer.

[#153850881]
2018-02-01 13:16:59 +01:00
Jean-Sébastien Pédron 531c551575 Merge branch 'add-dialyzer-attr-support-to-code_version' 2018-01-31 17:37:39 +01:00
Jean-Sébastien Pédron 9b10d49a25 Explicitly ignore return values we don't care about
These warnings were reported by Dialyzer.

[#153850881]
2018-01-31 17:27:01 +01:00
Jean-Sébastien Pédron 236a4f4bb5 worker_pool_worker: Fix set_timeout() specifications
This warning was reported by Dialyzer.

[#153850881]
2018-01-31 17:27:01 +01:00
Jean-Sébastien Pédron 68fe28b076 app_utils: Document explicitly anonymous functions which throw exceptions
Anonymous functions were converted to regular functions so that we could
add `-spec()` directives.

The `spec()` for the `error_handler()` callback was updated to accept
functions throwing exceptions.

This was reported by Dialyzer.

[#153850881]
2018-01-31 17:27:01 +01:00
Jean-Sébastien Pédron 591e3e23e3 .gitignore: Ignore PLT files from Dialyzer
[#153850881]
2018-01-31 17:27:01 +01:00
Jean-Sébastien Pédron caff514fe9 Merge branch 'add-dialyzer-attr-support-to-code_version' into v3.7.x 2018-01-31 17:25:49 +01:00
Jean-Sébastien Pédron 6419b8b8cc ssl_compat: Restore Dialyzer attribute now that `code_version` works with it
This reverts commit bc59e69e31.

[#154054286]
2018-01-31 17:08:11 +01:00
Jean-Sébastien Pédron 8df464d1cf code_version: Handle `-dialyzer` attributes
They can mention functions which we are removing or renaming. Therefore
we need to apply the same changes to the `-dialyzer` attribute(s).

[#154054286]
2018-01-31 17:07:58 +01:00
Jean-Sébastien Pédron ec7bdb3ab5 Merge branch 'limit-rabbitmq-components.mk-update-to-same-branch' into v3.7.x 2018-01-30 16:20:56 +01:00
Jean-Sébastien Pédron 7e342b04d6 Merge branch 'limit-rabbitmq-components.mk-update-to-same-branch' 2018-01-30 15:04:48 +01:00
Jean-Sébastien Pédron cca83231f0 rabbitmq-tools.mk: Move `rabbitmq-components.mk`-related targets there
This way, we are sure that the possibly newer recipe in
`rabbitmq-tools.mk` handles the operation instead of a possibly obsolete
`rabbitmq-components.mk` copy.

[#154761483]
2018-01-30 14:54:37 +01:00
Jean-Sébastien Pédron 73e2e89312 rabbitmq-components.mk: Compare branch names before updating `rabbitmq-components.mk`
To avoid a copy of `rabbitmq-components.mk` from rabbitmq-common's
`v3.6.x` branch to another component's `master` branch, we want to
compare branch names of both repositories.

This situation may occur when checking out the `v3.6.x` in the Umbrella
using `gmake up BRANCH=v3.6.x` but for instance some plugins don't have
such a branch. In this case, they remain on the previous branch. We
don't want to overwrite their `rabbitmq-components.mk` if this happens.

[#154761483]
2018-01-30 14:51:27 +01:00
Luke Bakken 21b10e9a9a Merge branch 'cowboy-update-154176350' 2018-01-29 16:20:02 -08:00
Luke Bakken 4df3a6f2a1 Update cowboy to 2.2.2 2018-01-29 16:02:24 -08:00
Luke Bakken bc59e69e31 Revert "ssl_compat: Silence Dialyzer warning about ssl:connection_info/1"
This reverts commit 44d02abe23.
2018-01-24 15:10:36 -08:00
Jean-Sébastien Pédron 9116add7dc .gitignore: Ignore PLT files
[#154054286]
2018-01-23 17:20:57 +01:00
Jean-Sébastien Pédron 98305dd9aa rabbitmq-components.mk: Fix $(possible_base_rmq_ref) value
It should be `master` because we are not in a release branch.
2018-01-23 17:20:57 +01:00
Karl Nilsson 2977180988 Revert "Extend amqqueue record to include queue type" 2018-01-23 15:26:07 +00:00
Jean-Sébastien Pédron 1c843e741f Merge branch 'sort-components-alphabetically' into v3.7.x 2018-01-23 12:48:26 +01:00
Jean-Sébastien Pédron 70fd88613d Merge branch 'sort-components-alphabetically' 2018-01-23 12:47:17 +01:00
Jean-Sébastien Pédron 2a33e25e34 rabbitmq-components.mk: Sort components alphabetically
[#154472152]
2018-01-23 12:46:22 +01:00
Diana Corbacho f6f1eb6c41 Merge branch 'rabbitmq-common-story-154472152' 2018-01-22 18:28:39 +00:00
Diana Corbacho adbb3a8a81 Merge branch 'rabbitmq-common-story-154472152' into v3.7.x 2018-01-22 18:26:30 +00:00
Diana Corbacho d2e287f5eb mk/rabbitmq-components.mk: Add ra as a dependency
[#154472152]
2018-01-22 18:19:35 +00:00
Jean-Sébastien Pédron 44d02abe23 ssl_compat: Silence Dialyzer warning about ssl:connection_info/1
... being removed in Erlang 20. We know we are not using it with Erlang
19+.

Signed-off-by: Daniil Fedotov <dfedotov@pivotal.io>

[#154054286]
2018-01-22 17:29:22 +01:00
Diana Corbacho 558285f849 Extend amqqueue record to include queue type
Defaults to 'classic'

[#154472130]
2018-01-22 14:11:37 +00:00
Gerhard Lazu aa2944236c Merge remote-tracking branch 'origin/allow-to-use-apps-directly-instead-of-ez-archives-in-umbrella' into v3.7.x 2018-01-18 14:43:28 +00:00
Gerhard Lazu 12020aaa24 Merge remote-tracking branch 'origin/allow-to-use-apps-directly-instead-of-ez-archives-in-umbrella' 2018-01-18 14:17:09 +00:00
Jean-Sébastien Pédron 98353f0489 rabbitmq-run.mk: Use plugins from `$(DEPS_DIR)` if `PLUGINS_FROM_DEPS_DIR` is defined
If the test broker is started using:

    gmake run-broker PLUGINS_FROM_DEPS_DIR=1

Then plugins are taken from `$(DEPS_DIR)` even though, the `.ez`
archives were created.

This can be handy when e.g. working in the management plugin's static
files: it makes it possible to modify a CSS and just reload the page to
see the change. There is no need to re-run `gmake run-broker`.

The value of `PLUGINS_FROM_DEPS_DIR` is not verified.

Caveats:
    * Irrelevant plugins which happend to be already compiled will
      be enabled because rabbitmq-plugins(8) will find them inside
      `$(DEPS_DIR).
    * This feature isn't tested when a plugin is cloned directly and
      it probably doesn't work. The developer is expected to use the
      Umbrella for now.

[#154435736]
2018-01-18 14:03:41 +01:00
Michael Klishin 747c3cfdea Bump (c) year
(cherry picked from commit 1bffc2d4a3)
2018-01-15 14:35:03 +03:00
Michael Klishin c1fcad0f4a Bump (c) year 2018-01-15 14:34:36 +03:00
Michael Klishin 1bffc2d4a3 Bump (c) year 2018-01-15 14:33:35 +03:00
Jean-Sébastien Pédron 9a043eef8d Merge branch 'add-commits-since-release-target' into v3.7.x 2018-01-08 14:07:43 +01:00
Jean-Sébastien Pédron c3ecea0e56 Merge branch 'add-commits-since-release-target' 2018-01-08 12:11:48 +01:00
Jean-Sébastien Pédron 7aad8fc90e rabbitmq-tools.mk: Add `commits-since-release` target
This target is useful to get the list of commits since the last
(pre)release or a specified tag in all RabbitMQ repositories involved
(i.e. the current project and its RabbitMQ dependencies). In particular,
from rabbitmq-server-release, it can help during the review of all
commits, issues and pull requests while preparing a release.

To see an interactive list of commits for each repository:

    gmake commits-since-release

To get the same list formatted as Markdown (to publish on GitHub):

    gmake commits-since-release MARKDOWN=yes

To get the commits since the last prerelease:

    gmake commits-since-release SINCE_TAG=last-prerelease

To get the commits since a specific release:

    gmake commits-since-release SINCE_TAG=v3.7.1

[#153087397]
2018-01-08 11:50:39 +01:00
Jean-Sébastien Pédron 09f26a3243 Merge branch 'rabbitmq-management-528' 2018-01-03 09:54:30 +01:00
Michael Klishin 2ac800d293 Introduce rabbit_data_coercion:{to_map/1, to_proplist/1}
References rabbitmq/rabbitmq-management#528, rabbitmq/rabbitmq-mqtt#156.
2018-01-02 22:25:16 +08:00
Michael Klishin b2e65761d8 Peer discovery backend: add an optional init callback
Part of rabbitmq/rabbitmq-peer-discovery-common#5.

[#153615554]

(cherry picked from commit cb898f5e9c)
2017-12-15 14:16:16 +03:00
D Corbacho ff50d9d100 Merge pull request #245 from rabbitmq/rabbitmq-peer-discovery-common-5
Peer discovery backend: add an optional init callback
2017-12-14 17:22:51 +01:00
Jean-Sébastien Pédron 6382300b61 Travis CI: The base branch may become v3.8.x one day
For now, this is mostly used a placeholder for a future change.
2017-12-14 17:09:10 +01:00
Jean-Sébastien Pédron 6193d40b0b Travis CI: The base branch is v3.7.x 2017-12-14 17:05:54 +01:00
Jean-Sébastien Pédron ca00dbf935 Travis CI: `stable` was renamed to `v3.6.x`
[#153670511]
2017-12-14 17:01:06 +01:00
Michael Klishin cb898f5e9c Peer discovery backend: add an optional init callback
Part of rabbitmq/rabbitmq-peer-discovery-common#5.

[#153615554]
2017-12-14 18:40:03 +03:00
Jean-Sébastien Pédron 8726b8996a rabbitmq-components.mk: Switch base branch to `v3.6.x`
We are about to rename `stable` to `v3.6.x`. That's why we need to
update the script which determines if a development branch was forked
from `v3.6.x` (instead of `stable`) and falls back to `master` if it's
not the case.

While here, handle the case where the `master` branch doesn't exist
locally. This happens when using `git clone -b $branch` or in CI.

(cherry picked from commit 037bab7f799bf9cc180b0dfa2b7899b7a464cf9d)
2017-12-14 14:13:00 +01:00
Loïc Hoguin 29da36157a Add a macro to identify processes in Looking Glass 2017-12-12 12:35:41 +01:00
Jean-Sébastien Pédron 790c7c150c rabbitmq-mix.mk: New Makefile to integrate with Mix in the source archive
This file is copied to Elixir-based components (e.g. rabbitmq_cli) when
we create the source archive of RabbitMQ. It allows RabbitMQ to build
offline (which is the case in many package build farms).

References rabbitmq/rabbitmq-server-release#61.
[#153358632]
2017-12-07 12:05:01 +01:00
Jean-Sébastien Pédron d0c17eff47 rabbitmq-components.mk: Import changes from `master`
Namely:
 * Fix `check-rabbitmq-components.mk` for rabbitmq-common.
2017-12-01 17:05:21 +01:00
Jean-Sébastien Pédron df3f2af3f3 rabbitmq-components.mk: Import changes from `master`
Namely:
 * Depend on ranch_proxy_protocol 1.4.4 (which depends on ranch 1.4.0,
   the same as us).
 * Fix `check-rabbitmq-components.mk` for rabbitmq-common.
2017-12-01 15:04:35 +01:00
Jean-Sébastien Pédron 77e66bba35 rabbitmq-components.mk: Set Cowboy pinning to 2.0.0 and Ranch to 1.4.0
This change was committed to the management-related plugins directly
during the switch to Cowboy 2.0. Unfortunately, it was lost when
rabbitmq-components.mk was updated globally.

Therefore this commit restores the new expected pinning.
2017-11-28 13:55:46 +01:00
Jean-Sébastien Pédron 23bc5cc1b5 Revert "rabbitmq-components.mk: Skip CI when updating rabbitmq-components.mk"
Unfortunately, the "skip CI" feature isn't what I would expect: I
expected that such a commit would not trigger a job, but that the commit
would still be picked by a job triggered for another reason. In fact,
it's entirely ignored: the resource will be stuck at the previous
commit, until another regular commit (i.e. without the "skip CI"
message) is pushed.

This reverts commit c9e636c0b4.
2017-11-28 13:03:12 +01:00
Jean-Sébastien Pédron c9e636c0b4 rabbitmq-components.mk: Skip CI when updating rabbitmq-components.mk
A build will be triggered anyway because of the initial commit of
rabbitmq-components.mk to rabbitmq-common.
2017-11-28 12:56:09 +01:00
Jean-Sébastien Pédron 95aca57abd rabbitmq-components.mk: Switch base branch to `v3.7.x`
Therefore, after we branch `v3.7.x`, rabbitmq-components.mk will try to
determine if a development branch was forked from `v3.7.x` (instead of
`stable`) and fallback to `master` if it's not the case.

While here, handle the case where the `master` branch doesn't exist
locally. This happens when using `git clone -b $branch` or in CI.
2017-11-28 12:43:04 +01:00
Jean-Sébastien Pédron 722eb5aa06 Merge branch 'stable' 2017-11-08 10:08:06 +01:00
Jean-Sébastien Pédron 255077a79f rabbitmq-tools.mk: Remove set -x from replace_aws_creds
It was only useful during debuggin.

[#152509619]
2017-11-08 10:07:34 +01:00
Jean-Sébastien Pédron 3efe79bfaf Merge branch 'stable' 2017-11-07 14:21:00 +01:00
Jean-Sébastien Pédron 5d4e6318bd rabbitmq-tools.mk: It's ok if the existing .travis.yml has no encrypted env. vars
[#152509619]
2017-11-07 12:37:08 +01:00
Jean-Sébastien Pédron c05addf2b1 Merge branch 'stable' 2017-11-06 19:55:22 +01:00
Jean-Sébastien Pédron aca81b436b rabbitmq-tools.mk: Restore AWS creds when syncing .travis.yml
In other words, instead of copying rabbitmq-common's credentials which
won't be valid in another project, keep the existing credentials (if
any).

Tha said, if CREDS is set, they will be overwritten again.

[#152509619]
2017-11-06 19:53:07 +01:00
Jean-Sébastien Pédron 84bca32db6 Merge branch 'stable' 2017-11-06 19:22:10 +01:00
Jean-Sébastien Pédron 5d2ab49087 rabbitmq-tools.mk: Set AWS credentials in the `travis-yml` target
... if CREDS, the path to `pipeline-credentials.yml` is set.

This is used to upload logs to Amazon S3 when a build fails.

[#152509619]
2017-11-06 19:19:09 +01:00
Jean-Sébastien Pédron c167ef1b23 Travis CI: Publish logs to Amazon S3 in case of failure
Credentials are taken from Concourse pipeline credentials. One has to
set CREDS:

    gmake travis-yml CREDS=/path/to/pipeline-credentials.yaml

[#152509619]
2017-11-06 17:56:29 +01:00
Jean-Sébastien Pédron b9f90556d2 Merge branch 'stable' 2017-11-03 17:46:53 +01:00
Jean-Sébastien Pédron f6360209aa rabbitmq-tools.mk: New target to help keep `.travis.yml` synchronized
It assumes that all projects use the same `.travis.yml` usually (we try
to achieve the same in Concourse). For special cases, like e.g.
rabbitmq-amqp1.0 which needs .NET Core, there is a `.travis.yml.patch`
in the project which is applied to the stock `.travis.yml`.

Like `rabbitmq-components-mk`, it accepts a `DO_COMMIT=yes` variable to
automatically create a commit if there is a change to `.travis.yml`.

There is also a `update-travis-yml` to update it recursively.

[#152509619]
2017-11-03 17:37:05 +01:00
Luke Bakken 490800b77b Merge pull request #239 from rabbitmq/rabbitmq-server-batch-betas-lrb
Introduce handle_info callback
2017-11-02 11:22:04 -07:00
Jean-Sébastien Pédron ad337ecad9 rabbitmq-early-test.mk: Do not use ct_styled_out on Travis CI (take #2)
This time, avoid to erase the value of $(TEST_DEPS)...

[#152509619]
2017-11-02 18:45:58 +01:00
Jean-Sébastien Pédron f7e0ca04f8 rabbitmq-early-test.mk: Do not use ct_styled_out on Travis CI
Escape sequences used to move cursor around are not properly translated
in the HTML output, thus defeating the purpose of the Common Test output
module.

[#152509619]
2017-11-02 18:35:49 +01:00
Jean-Sébastien Pédron 757dac1858 Merge branch 'stable' 2017-11-02 17:59:54 +01:00
Jean-Sébastien Pédron 6cd6a668b5 Travis CI: Run `make xref` in addition to `make tests`
While here, test on Erlang 20.1. Also, we stop testing on Erlang 19.2:
it's now unsupported.

We take Elixir from Erlang Solutions packages because kiex is affected
by GitHub API rate limiting.

Finally, the sections are reordered so the scripts are at the end. It
may help in the future if we want to template all the `.travis.tml`
files.

[#152509619]
2017-11-02 17:58:40 +01:00
Jean-Sébastien Pédron 3a2e613fdc Travis CI: Run `make xref` in addition to `make tests`
While here, test on Erlang 19.3 (instead of 19.0) and Erlang 20.1. Also,
we stop testing on Erlang 17.5 and 18.3: it helps reduce the number of
jobs in Travis CI and allow it to go over all changes quicker.

Finally, the sections are reordered so the scripts are at the end. It
may help in the future if we want to template all the `.travis.tml`
files.

[#152509619]
2017-11-02 15:11:52 +01:00
Luke Bakken 475eeb9c0a Introduce handle_info callback
This can be used to handle generic messages that the parent gen_server2 wishes to pass to backing queues. Initially used for the bump_reduce_memory_use message.

Part of rabbitmq/rabbitmq-server#1393
2017-11-02 06:54:48 -07:00
Jean-Sébastien Pédron 8149f9cbff erlang.mk: Disable `proper` plugin
[#152509619]
2017-11-02 14:40:37 +01:00
Luke Bakken 1eef0d2e2c Merge branch 'master' into rabbitmq-management-499-followup 2017-10-31 07:35:26 -07:00
Diana Corbacho 76a2586fa1 Add API to get rss memory
[#152311595]
2017-10-31 11:42:35 +00:00
Daniil Fedotov 3b57b0c35a Replace orddicts with maps 2017-10-30 14:44:34 +00:00
Daniil Fedotov ba3f94754a Fix types after merge stable 2017-10-27 19:32:05 +01:00
Daniil Fedotov a7e323994f Merge branch 'stable' 2017-10-27 19:30:14 +01:00
Gerhard Lazu 1fa2b68fbf Merge pull request #237 from rabbitmq/rabbitmq-server-1216-backport
Start `rabbit` application as transient.
2017-10-27 12:26:26 +01:00
Daniil Fedotov 472c605fe5 Start `rabbit` application as transient.
This is a backport of #194
[#152310581]
2017-10-26 16:46:11 +01:00
Michael Klishin 9348b27486 Merge branch 'stable' 2017-10-26 17:05:11 +03:00
Michael Klishin c5ecd2a467 Merge branch 'stable' 2017-10-25 21:10:29 +03:00
Daniil Fedotov 3bef28f1c4 An API to get non-cached process memory. 2017-10-25 17:34:39 +01:00
Diana Corbacho b2aaa5f508 Simplify gen_server2:cast
[#152240490]
2017-10-25 11:27:18 +01:00
Diana Corbacho 0006ac83a3 Use read_concurrency on core tables
[#152240490]
2017-10-25 11:19:08 +01:00
Jean-Sébastien Pédron 123b30e508 include/rabbit.hrl: Bump Erlang requirement to 19.3 (ERTS 8.3)
[#152067396]
2017-10-23 12:47:27 +02:00
Jean-Sébastien Pédron 41677e35fa Merge branch 'stable' 2017-10-20 09:03:01 +02:00
Jean-Sébastien Pédron 54ff0ee888 rabbitmq-hexpm.mk: Allow to override version pinning
... for `rabbit_common` and `amqp_client`.

This should only be used for testing purpose (e.g. dry-run in CI),
otherwise dependency tracking will break: `amqp_client` depends on a
specific version of `rabbit_common`.

However in CI, we want to be able to do a publish dry-run of
`amqp_client`. As it requires `rabbit_common` to be published, we need
to override the version pinning to point it to an already published
version of `rabbit_common` (the corresponding version of `rabbit_common`
was not published either). This is ok because nothing is published in
the end.

[#150482173, #150482202]
2017-10-20 09:02:48 +02:00
Luke Bakken 3986c765dc Merge branch 'stable' 2017-10-19 06:58:47 -07:00
Luke Bakken 6ca3e4177c Default mem calc strategy should be "rss"
This is due to a scenario in which the Erlang VM allocator stats report a huge increase in memory consumption which is only reflected in VSS increase, not RSS

PT #152081051
2017-10-18 14:39:51 -07:00
Luke Bakken c6838fce9b Port ensure_all_started and modify to use RestartTypes map 2017-10-16 09:44:11 -07:00
Jean-Sébastien Pédron bff1b7eabf Merge branch 'stable' 2017-10-16 17:11:55 +02:00
Jean-Sébastien Pédron 3cce066955 rabbitmq-macros.mk: Move `compare_version` macro to its own file
This way, it can be used with including rabbitmq-build.mk.
2017-10-16 17:08:55 +02:00
Jean-Sébastien Pédron f086d5b05f app_utils: Make `rabbit` app transient again
Now, when the `rabbit` application stops with an error, the Erlang node
exits.

This restores the behavior introduced by rabbitmq/rabbitmq-server#1216
but removed in commit 7a8f7be7c4. This
broke the `erlang_config` testcase in the `clustering_management`
testsuite (rabbitmq-server).
2017-10-16 12:12:31 +02:00
Michael Klishin c3589141b6 This should be MIN_ERTS_VER
The new state is used starting with OTP 18, not up to it
2017-10-16 10:44:59 +03:00
Michael Klishin 5a6d407607 Manually apply #230 to master 2017-10-16 03:34:36 +03:00
Michael Klishin 2ed32e450d Merge pull request #230 from feng19/new_sup2_state
fix supervisor2's state for get {badrecord,state} error when release upgrade
2017-10-15 16:22:22 -07:00
Jean-Sébastien Pédron de6c34decb Merge branch 'stable' 2017-10-13 14:31:55 +02:00
Jean-Sébastien Pédron 882e2c8409 rabbitmq-components.mk: Add AMQP 1.0 client & common library 2017-10-13 14:31:14 +02:00
Michael Klishin 63ec01089a Add random exchange plugin
(cherry picked from commit 4b624fa546)
2017-10-13 12:59:41 +02:00
Jean-Sébastien Pédron bb147ac748 rabbitmq-hexpm.mk: No need to override version pinning for `rebar.config`
We now always take 3rd-party dependencies from Hex.

[#150482173]
2017-10-13 11:51:54 +02:00
Jean-Sébastien Pédron 589126b2a2 Merge branch 'stable' 2017-10-13 11:13:43 +02:00
Jean-Sébastien Pédron 34e9ac31b9 rabbitmq-hexpm.mk: Copy 3rd-party dependencies to rabbitmq-componentS.hexpm.mk
When we publish our packages to Hex.pm, we use the simplified
rabbitmq-components.hexpm.mk to replace the regular
rabbitmq-components.mk.

Before commit ba59f969b7,
rabbitmq-components.mk took 3rd-party dependencies from GitHub. Now that
it takes them from Hex.pm, we don't need to override and hard-code them
again in rabbitmq-components.hexpm.mk.

Thus now, we extract them from rabbitmq-components.mk and put them at
the end of rabbitmq-components.hexpm.mk when we publish to Hex.pm.

The other benefit is that we don't have to remember to change version
pinning in both rabbitmq-components.mk and rabbitmq-components.hexpm.mk.

[#150482173]
2017-10-13 10:47:45 +02:00
Jean-Sébastien Pédron ba59f969b7 rabbitmq-components.mk: Take 3rd-party dependencies from Hex.pm
This way, when we publish our own packages to Hex.pm (rabbitmq-common
and rabbitmq-erlang-client as of now), we are sure that no dependency
will miss from Hex.pm.

Before that, 3rd-party dependencies were taken from GitHub, and only
when we published to Hex.pm, the source was overriden and set to Hex.pm.
This led to bad surprises such as `ranch_proxy_protocol` which was
unavailable on Hex.pm, preventing us from publishing our packages.

While here, remove pinning for mochiweb and webmachine which we are not
using anymore.

[#150482173]
2017-10-13 10:16:04 +02:00
feng19 1569cf21aa fix supervisor2's state for get {badrecord,state} error when release upgrade 2017-10-13 13:23:56 +08:00
Michael Klishin a63ff6bedb Fix a DEPS merge 2017-10-12 18:37:47 +03:00
Michael Klishin 1addd306d0 Merge branch 'rabbitmq-common-224-compat-fixes'
Conflicts:
	src/vm_memory_monitor.erl

Correctly merge DEPS in Makefile along the way.
2017-10-12 18:35:57 +03:00
Luke Bakken 461f67e088 Add recon license file 2017-10-12 18:31:28 +03:00
Luke Bakken d825fb726a Default to allocated after doing more testing 2017-10-12 18:31:27 +03:00
Luke Bakken 87b86f253f Handle edge case where gen_server is not running 2017-10-12 18:31:27 +03:00
Luke Bakken e35e235180 Cache more info in state, use /proc to get RSS memory on Linux and ps on other systems, recon on Win32 2017-10-12 18:31:27 +03:00
Luke Bakken e78cbc9c8d Simplify memory strategy code a bit 2017-10-12 18:31:27 +03:00
Luke Bakken 74d801fbf4 Revert "Revert "Merge branch 'rabbitmq-common-224' into stable""
This reverts commit 9cacaddbe5.
2017-10-12 18:31:27 +03:00
Luke Bakken 7a8f7be7c4 Change recon to a build dep to remove applicaton dependency
DEPS it is

Use application:ensure_all_started to start up dependencies as well
2017-10-12 18:31:27 +03:00
Luke Bakken b0485159a5 Fix issues uncovered after merging #224
Follow-up to #224

* R16 compatibility
* Trap noproc in an additional case
2017-10-12 07:00:46 -07:00
Luke Bakken 3aee93f048 Add recon license file 2017-10-11 09:42:59 -07:00
Luke Bakken 8f4bf387a1 Default to allocated after doing more testing 2017-10-10 16:27:47 -07:00
Luke Bakken ab56ab30d3 Handle edge case where gen_server is not running 2017-10-10 08:09:41 -07:00
Luke Bakken 8af82578c5 Cache more info in state, use /proc to get RSS memory on Linux and ps on other systems, recon on Win32 2017-10-10 08:09:41 -07:00
Luke Bakken 798091ad75 Simplify memory strategy code a bit 2017-10-06 11:47:30 -07:00
Luke Bakken 72ef6dde19 Revert "Revert "Merge branch 'rabbitmq-common-224' into stable""
This reverts commit 9cacaddbe5.
2017-10-06 11:43:17 -07:00
Luke Bakken 1578bba13e Change recon to a build dep to remove applicaton dependency
DEPS it is

Use application:ensure_all_started to start up dependencies as well
2017-10-06 10:10:50 -07:00
Michael Klishin 1cc6f99d7c Merge branch 'stable' 2017-10-06 12:56:01 +01:00
Michael Klishin 9cacaddbe5 Revert "Merge branch 'rabbitmq-common-224' into stable"
This reverts commit d553e72af9, reversing
changes made to 5b014bae4b.

This needs more work on the server end: recon must be started by the time
vm_memory_monitor runs.
2017-10-06 12:53:33 +01:00
Michael Klishin ace2ec7adc Merge branch 'stable' 2017-10-06 12:17:10 +01:00
Michael Klishin 066d5d5a06 Explain 2017-10-06 12:06:08 +01:00
Luke Bakken 952ca67d6d Add some additional calculation strategy options 2017-10-05 07:31:55 -07:00
Luke Bakken 623da5ea57 Use recon_alloc:memory for all memory calculation 2017-10-04 13:41:19 -07:00
Luke Bakken d03bc866a0 Use recon_alloc:memory on Win32
Fixes #224
2017-10-03 12:59:53 -07:00
Jean-Sébastien Pédron 2f350dc77c mk/rabbitmq-hexpm.mk: Take rabbit_common deps from Hex.pm
Otherwise, we use the Git repository. At some point, we might consider
using Hex.pm all the time.

[#150482173]
2017-09-28 14:49:00 +02:00
Jean-Sébastien Pédron d689a3d75e mk/rabbitmq-components.mk: Pin jsx and lager versions
We were using the `master` branch before.

While here, we extract the version of `ranch_proxy_protocol` and store
it in a dedicated variable. This will be used in `rabbitmq-hexpm.mk` to
prepare `rebar.config`.
2017-09-28 14:35:00 +02:00
Michael Klishin 2e3e2f8675 Merge branch 'stable' 2017-09-27 10:19:46 +03:00
Michael Klishin f999d06734 Wording 2017-09-27 09:15:56 +03:00
Luke Bakken 5a243297fa Revert to using erlang:memory() on Win32
Fixes rabbitmq/rabbitmq-server#1343
2017-09-26 11:30:10 -07:00
Michael Klishin 7557a0b3d7 Merge branch 'stable' 2017-09-18 14:36:17 -06:00
Michael Klishin 77571fa551 Merge branch 'stable' into rabbitmq-server-1343 2017-09-17 12:39:52 -06:00
Luke Bakken 4dedff662d Remove unused define 2017-09-14 08:27:11 -07:00
Luke Bakken aabd8eb9dc revert whitespace change 2017-09-14 07:42:46 -07:00