dispatch_sync sits inbetween the behavior of submit and submit_async,
blocking the caller until a worker begins the task, as opposed
to not blocking at all, or blocking util the task has finished.
This is useful when you want to throttle submissions to the pool
from a single process, such that all workers are busy, but there
exists no backlog of work for the pool.
The previous value accepted for this behavior was "NONE". But it's more
intuitive to set it to nothing.
`rabbitmq-run.mk` is also updated to allow `$RABBITMQ_ENABLED_PLUGINS`
to be overriden e.g. on the command line.
It guesses the node name type, based on the host part of a node name.
I.e., if it contains at least a `.` character, it's a longname.
This matches the verification `net_kernel` does to make sure the node
name corresponds to the shortnames/longnames option.
I.e. we record the fact that a particular value:
* is the default value, or
* comes from an environment variable, or
* comes from querying a remote node
This required a significant refactoring of the module, which explains
the large diff.
At the same time, the testsuite was extended to cover more code and
situations.
This work permits us to move remaining environment variables checked by
`rabbit` to this module. They include:
* $RABBITMQ_LOG_FF_REGISTRY
* $RABBITMQ_FEATURE_FLAGS
* $NOTIFY_SOCKET
[#170149339]
... and default values.
It can also query a remote node for some specific values. The use case
is the CLI which should know what the RabbitMQ node it controls uses
exactly.
It supports several new environment variables:
RABBITMQ_DBG:
Used to setup `dbg` for some simple tracing scenarios.
RABBITMQ_ENABLED_PLUGINS:
Used to list plugins to enable automatically on node startup.
RABBITMQ_KEEP_PID_FILE_ON_EXIT:
Used to indicate if the PID file should be removed or kept when the
node exits.
RABBITMQ_LOG:
Used to configure the global and per-category log levels and enable
ANSI colors.
... 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]
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
Prior to this change, setting the vm_memory_high_watermark to a value
higher than 1 (inclusive), would default to 0.4. This is different from
the behaviour when setting an absolute value, namely defaulting to the
total memory available.
Extracted common memory-related macros & records so that they can be
shared by tests.
re rabbitmq/rabbitmq-server#1285
[finishes #148470947]
Even thought I was leaning towards EUnit at first, since CT was already there
and is already used for unit testing, it made the choice easy. I didn't
like the fact that I had to export the function to test it, but maybe
I'm missing something.
As for the test itself, I tried a couple of approaches and finally
settled on "if it starts with 'Erlang/OTP (MAJOR_VERSION)`, we're good.
Happy to hear better alternatives.
Variables to expand are extracted from the AMQP params
(only internal, not network). This allows to propagate
some upstream variables (e.g. MQTT client_id).
References rabbitmq/rabbitmq-server#1229
The expansion is done inside the internal authz backend
and the variables to expand are provided in a map from
the context parameter. This decoupling allows to provide
different variables to expand based on the caller context
(e.g. add other variables to expand from the MQTT plugin).
References rabbitmq/rabbbitmq-server#1229
Pid binary format has changed in OTP-20.0.
We can still get the node using node/1, so we can
skip the node part when decomposing a pid.
Added unit tests for decomposing and composing a pid and changing
the node.
Pid binary format has changed in OTP-20.0.
We can still get the node using node/1, so we can
skip the node part when decomposing a pid.
Added unit tests for decomposing and composing a pid and changing
the node.
They are pulled by amqp_client and can create conflicts with
other libraries when developers build releases with the Rabbit
client and Mochiweb, for example.
* mochiweb_util -> rabbit_http_util
* mochinum -> rabbit_numerical
* ec_semver -> rabbit_semver
3.6.6 will introduce a change to the schema.
e.g. 3.6.6 is not compatible with 3.6.5
This special case can be removed once 3.6.x reaches EOL
[#132175569]
Use ec_semver from erlware for implementation. This is the same module
used in rebar3.
This changes some existing behaviour, e.g.:
3.0 is now minor-equivalent to 3.0.0 and 3.0.0.1
'master' is now a valid in version_compare
Add property tests
[#131650399]