summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2263 from rabbitmq/qq-dead-letter-bugArnaud Cogoluègnes2020-02-282-7/+7
|\ | | | | Take snapshots when messages are returned
| * Take snapshots when messages are returnedqq-dead-letter-bugkjnilsson2020-02-282-7/+7
| | | | | | | | | | | | and there is a delivery-limit in place. Also fix rabbit_fifo tests.
* | Merge pull request #2262 from rabbitmq/qq-dead-letter-bugArnaud Cogoluègnes2020-02-282-13/+47
|\ \ | |/ | | Fix QQ dead letter crash
| * Fix QQ dead letter crashkjnilsson2020-02-282-13/+47
|/ | | | | | that would occur when dead-lettering a message that was not kept in memory. At that point the dead lettering function failed as the message had not be restored from the Ra log.
* Merge pull request #2258 from rabbitmq/load-several-config-filesJean-Sébastien Pédron2020-02-282-14/+49
|\ | | | | Load additional Cuttlefish configuration files
| * rabbit_prelaunch_conf: Load additional Cuttlefish configuration filesJean-Sébastien Pédron2020-02-281-7/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default, in addition to `$RABBITMQ_CONFIG_FILE`, we also load all matching `$RABBITMQ_CONFIG_FILES`. It allows to split the configuration into many files for easier management. Here is the behavior in more details: * If `$RABBITMQ_CONFIG_FILES` is a directory, all files directly inside it are considered. * If `$RABBITMQ_CONFIG_FILES` is a glob pattern, all files matching the pattern are considered. * In both cases, subdirectories (and whatever they contain) are ignored. * `$RABBITMQ_CONFIG_FILES` is only relevant when the main configuration is either missing (the file does not exist or is empty) or uses the Cuttlefish format. * Additional configuration files must use the Cuttlefish format. The default value of `$RABBITMQ_CONFIG_FILES` is: * `/etc/rabbitmq/conf.d/*.conf` on Unix * `%APPDATA%\RabbitMQ\conf.d\*.conf` on Windows Error messages related to Cuttlefish parsing were improved in the process. [#171491267]
| * rabbit_prelaunch_conf: Remove out-of-date commentJean-Sébastien Pédron2020-02-281-1/+0
| | | | | | | | We already try both formats when we parse the configuration.
| * rabbit: Do not load configuration twiceJean-Sébastien Pédron2020-02-281-6/+3
|/ | | | It was already loaded in `rabbit_prelaunch` (prelaunch phase 1).
* Avoid using erlang:get_stacktrace/0 for improved OTP 23/24 compatMichael Klishin2020-02-274-9/+8
|
* Merge pull request #2260 from rabbitmq/optimise-qq-recoveryGerhard Lazu2020-02-263-25/+42
|\ | | | | Optimise messages_ready function by keeping counts of prefix messages
| * Optimise messages_ready function by keeping counts of prefix messageskjnilsson2020-02-263-25/+42
| | | | | | | | | | rather than taking length/1. There could be a lot of prefix messages during during recovery which could make recovery unbearably slow.
* | Merge pull request #2259 from rabbitmq/fix-dialyzer-error-in-sighandlerJean-Sébastien Pédron2020-02-261-5/+8
|\ \ | |/ |/| rabbit_prelaunch_sighandler: Comment out code which is unused
| * rabbit_prelaunch_sighandler: Comment out code which is unusedJean-Sébastien Pédron2020-02-261-5/+8
| | | | | | | | | | | | | | | | | | | | As it is ready to handle the stop of RabbitMQ and has been tested, we can keep the code around just in case. However, this causes a Dialyzer error which must be fixed, so let's comment it out. [#171234776]
* | Merge pull request #2255 from rabbitmq/qq-remove-member-fixMichael Klishin2020-02-252-5/+65
|\ \ | |/ |/| Split QQ remove member into two operations
| * quorum_queue suite: remove a couple of stray commentsMichael Klishin2020-02-251-2/+0
| |
| * Split QQ remove member into two operationskjnilsson2020-02-242-5/+67
| | | | | | | | | | | | | | | | | | To avoid not updating the amqqueue record if the server data delete part failed but the Raft cluster was still updated. Also add a function to repair the quorum queue queue type nodes in the amqqrecord if it should diverge from what the Ra cluster thinks. [#171434221]
* | Merge pull request #2256 from rabbitmq/rabbit-fifo-dead-letter-bugMichael Klishin2020-02-253-11/+37
|\ \ | | | | | | Fix QQ crash recovery bug
| * | Fix QQ crash recovery bugkjnilsson2020-02-253-11/+37
| |/ | | | | | | | | | | | | | | | | When using dead letter handlers the state machine would crash when a prefix_msg was being dead-lettered on recovery. This handles this case and also fixes an issue where the incorrect initial release cursor interval would have been set when overriding the release cursor default. [#171463230]
* | Merge pull request #2257 from rabbitmq/export-product_info-in-statusMichael Klishin2020-02-251-1/+7
|\ \ | | | | | | rabbit: Export product info in `status()`
| * | rabbit: Export product info in `status()`Jean-Sébastien Pédron2020-02-251-1/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | Therefore, the underlying RabbitMQ version remains available through the same key, `rabbitmq_version`. The product information is available using two new keys: * `product_name` * `product_version` While here, `base_product_name()` and `base_product_version()` functions are exported to allow plugins to get the RabbitMQ default name & version. [#171467799]
* | Merge pull request #2253 from rabbitmq/skip-signal-handler-on-windowsMichael Klishin2020-02-241-7/+12
|\ \ | |/ |/| rabbitmq_prelaunch: Skip signal handler on Windows
| * rabbitmq_prelaunch: Skip signal handler on WindowsJean-Sébastien Pédron2020-02-241-7/+12
|/ | | | | | | This is specific to Unix, and `os:set_signal()` reminded it to me with a `badarg` exception. [#171234776]
* Merge pull request #2247 from ↵Gerhard Lazu2020-02-203-12/+196
|\ | | | | | | | | rabbitmq/support-configurable-product-name-and-banner Add ability to customize product name, version & banner
| * Add ability to customize product name, version & bannerJean-Sébastien Pédron2020-02-203-12/+196
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To override the product name (defaulting to "RabbitMQ"): * set the `$RABBITMQ_PRODUCT_NAME` environment variable, or * set the `rabbit` application `product_name` variable. To override the product version: * set the `$RABBITMQ_PRODUCT_VERSION` environment variable, or * set the `rabbit` application `product_version` variable. To add content to the banner (both the copy logged and the one printed to stdout), indicate the filename which contains it, à la `/etc/motd` using: * the `$RABBITMQ_MOTD_FILE` environment variable, or * the `rabbit` application `motd_file` variable. The default motd file is `/etc/rabbitmq/motd` on Unix and `%APPDATA%\RabbitMQ\motd.txt` on Windows. Here is an example of the printed banner with name, version & motd configured: ## ## WeatherMQ 1.2.3 ## ## ########## Copyright (c) 2007-2020 Pivotal Software, Inc. ###### ## ########## Licensed under the MPL 1.1. Website: https://rabbitmq.com This is an example of a RabbitMQ message of the day. The message is written in Paris, France. \ / It is partly cloudy outside, with a _ /"".-. temperature of 12°C. Wind is around \_( ). 30-40 km/h, from south-west. /(___(__) Doc guides: https://rabbitmq.com/documentation.html Support: https://rabbitmq.com/contact.html Tutorials: https://rabbitmq.com/getstarted.html Monitoring: https://rabbitmq.com/monitoring.html Logs: /tmp/rabbitmq-test-instances/rabbit/log/rabbit@cassini.log /tmp/rabbitmq-test-instances/rabbit/log/rabbit@cassini_upgrade.log Config file(s): /tmp/rabbitmq-test-instances/test.config Starting broker... completed with 0 plugins. New APIS are available to query those product informations and use them in e.g. plugins such as the management API/UI: * rabbit:product_info/0 * rabbit:product_name/0 * rabbit:product_version/0 * rabbit:motd_file/0 * rabbit:motd/0 [#170054940]
* Compiles from scratchMichael Klishin2020-02-201-4/+2
|
* Merge pull request #2244 from rabbitmq/only-handle-SIGHUP-and-SIGTSTPGerhard Lazu2020-02-205-68/+97
|\ | | | | Only handle SIGHUP and SIGTSTP
| * Only handle SIGHUP and SIGTSTPJean-Sébastien Pédron2020-02-205-68/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here is a summary of RabbitMQ signal handling: == SIGTERM == After #2180, `rabbit` is a regular Erlang application and `application:stop(rabbit)` terminates RabbitMQ gracefully. This means that `init:stop()` shuts the service down properly. Therefore, the default handling of SIGTERM, which calls `init:stop()`, is correct. rabbitmq-server(8) already relies on this mechanism. This commit restores the default signal handler which already does the right thing. No need to do it ourselves. == SIGHUP and SIGTSTP == SIHGUP is usually used to reload the configuration without restarting the service and/or reopen log files after log file rotation. SIGTSTP is sent when a user types Ctrl+Z to pause a program and get back to the shell. Both signals have common behavior we can't satisfy currently. Note that we don't handle SIGCONT which is the one used to resume a program after SIGTSTP. The system default behavior is already good (the signal is discarded). To be consistent with rabbitmq-server(8) signal handling, the signals are ignored until we can do something about them. == SIGQUIT == This signal is meant to terminate the process immediately and create a core dump. If possible, temporary files should even be kept around. The default behavior in Erlang is to call `erlang:halt()` which is a sane default: we should not stop RabbitMQ gracefully. This commit restores this behavior. == SIGUSR1 and SIGUSR2 == Erlang uses SIGUSR1 to crash the VM and create an `erl_crash.dump` file. We already used this in the past to debug RabbitMQ. Again, a sane default. This commit restores this behavior. == Other signals == We keep the default behavior of all other signals. None of them are meant to stop the program gracefully anyway. If a user wants to stop RabbitMQ, he will already use the common accepted signal for this purpose (i.e. SIGTERM). Another change in this commit is the way we setup the signal handler: * We don't replace the default Erlang signal handler, just add ours. * We do it very early in rabbitmq_prelaunch. Like other things configured by this application, we do not uninstall the handler when the application is stopped. This reverts: * commit 6a4d2721d06b8c70a36e29e6c51bbef6608def55 * commit fa607e4a25d6142bb17a90b44ef757572a923c09
* | Merge pull request #2248 from rabbitmq/mk-concurrent-definition-importMichael Klishin2020-02-208-37/+158
|\ \ | |/ |/| Concurrent definition import
| * Factor out some common codeLuke Bakken2020-02-191-45/+32
| |
| * Catch and report errors when importing definitions concurrentlyMichael Klishin2020-02-193-7/+66
| |
| * gatherer:stop/1 now does the unlinkingMichael Klishin2020-02-192-3/+0
| | | | | | | | so no need to do it twice
| * rabbit_definitions:concurrent_for_all/4: avoid an unintentional matchMichael Klishin2020-02-191-9/+4
| |
| * Import definitions concurrentlyMichael Klishin2020-02-182-26/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | …or rather, import some definition categories concurrently, namely users, virtual hosts, queues, exchanges and bindings. For some workloads this leads to a 20% to 70% reduction in definition import time. Note that for virtual hosts, most of the creation process steps cannot be made concurrent or significantly optimised without compromising the observed atomicity of HTTP API and CLI operations, so concurrent import both makes less of a difference and is the only realistic way of speeding up the process for virtual hosts. This introduces a dedicated work pool for import operations to avoid overloading the default pool, in particular on node boot when definitions can be imported concurrently with on disk data recovery steps which use the default pool heavily.
| * Do not export definitions of built-in exchangesMichael Klishin2020-02-182-3/+16
| | | | | | | | | | | | | | They are skipped during definition import and cannot be deleted by a client anyway. Per discussion with @dumbbell.
| * Make gatherer:stop/1 unlink the processMichael Klishin2020-02-181-0/+1
|/ | | | | | | | | | | The only way to start a gatherer process is via gatherer:start_link/1. This means that when a gatherer is stopped, its linked process may unexpectedly receive an exit notification on clean gatherer shutdown. It would be less surprising to the module user if a successful stop also unlinked this transient in nature process. Per discussion with @dcorbacho @dumbbell.
* Merge pull request #2246 from Ayanda-D/speedup-bootstepsMichael Klishin2020-02-151-15/+11
|\ | | | | Speedup execution of bootsteps
| * Speedup bootstep execution by removing unnecessaryAyanda Dube2020-02-141-15/+11
|/ | | | | | | | | filtering and grouping of MFA specifications. This improves speed of execution by factor of 2N, where N is number of attributes per step, matching the passed `AttributeName`. Dropping constants, overall time complexity remains O(N), but cant be neglected for modules with multiple bootstep attributes.
* Delist internal stats mode from rabbitmq.conf.exampleMichael Klishin2020-02-121-7/+6
| | | | | | See https://github.com/rabbitmq/discussions/issues/62 for details. Rates mode is how it is controlled but this leftover example was around several years after the switch.
* rabbitmq.conf.example: this should be a comment lineMichael Klishin2020-02-121-1/+1
|
* Add management.path_prefix to rabbitmq.conf.exampleMichael Klishin2020-02-121-1/+2
|
* Merge pull request #2241 from rabbitmq/dialyzer-fixes-in-rabbitmq-prelaunchJean-Sébastien Pédron2020-02-115-25/+42
|\ | | | | rabbitmq_prelaunch: Fix all warnings reported by Dialyzer
| * rabbitmq_prelaunch: Fix all warnings reported by DialyzerJean-Sébastien Pédron2020-02-115-25/+42
|/ | | | | | They are all return values being unmatched. Many were related to list comprehensions being used as a loop mechanism but the result was unused. These list comprehensions were replaced by lists:foreach/2.
* Update rabbitmq-components.mkGerhard Lazu2020-02-111-2/+2
|
* Merge pull request #2239 from rabbitmq/fix-setting-log-level-without-fileJean-Sébastien Pédron2020-02-101-29/+25
|\ | | | | Small refactor for 15dfe7b1bf63c6f6b9940738b219f08bcc241cbd
| * Fix setting log level to debugLuke Bakken2020-02-101-29/+25
|/ | | | In `rabbit_common/mk/rabbitmq-run.mk` the default is to use `debug` for the file log level. However, prior to this change that log level is not applied.
* Merge pull request #2231 from rabbitmq/extract_sd_notifyJean-Sébastien Pédron2020-02-106-195/+335
|\ | | | | Convert systemd notification to prelaunch steps
| * Convert systemd notification to prelaunch stepsPhilip Kuryloski2020-02-106-195/+335
|/ | | | | | | | | | | | | | | | | | Introduce the rabbit_boot_state module, which extracts boot state management out of rabbit_prelaunch. External boot state listeners, such as systemd, now live under the rabbit_boot_state_sup supervisor, which dispatches boot state updates to all of its children as a gen_server cast. Additionally: - the systemd listener now reads the NOTIFY_SOCKET env var directly, rather than through rabbit_env, to avoid the need to wait for the rabbit_env context to initialize - the sytemd listener now only checks for the sd_notify module and NOTIFY_SOCKET env var once upon startup, exiting gracefully when not needed - systemd related log messages are now routed through lager
* Merge pull request #2238 from rabbitmq/various-fixes-post-issue2180Jean-Sébastien Pédron2020-02-101-10/+9
|\ | | | | Various fixes post #2180
| * rabbit: Change boot state to `stopping` in prep_stop/1Jean-Sébastien Pédron2020-02-101-3/+3
| |
| * rabbit: Merge start_apps/2 and start_loaded_apps/2Jean-Sébastien Pédron2020-02-101-7/+6
|/ | | | | The latter is only ever called by the former, so there is no need to split them.