Commit Graph

2028 Commits

Author SHA1 Message Date
Luke Bakken 7fe159edef
Yolo-replace format strings
Replaces `~s` and `~p` with their unicode-friendly counterparts.

```
git ls-files *.erl | xargs sed -i.ORIG -e s/~s>/~ts/g -e s/~p>/~tp/g
```
2022-10-10 10:32:03 +04:00
Luke Bakken 553aab51c9
Update branch names and links
Fix publish of libs to hex.pm

@lhoguin noticed that the hex packages for the amqp_client, amqp10_client and related project do not currently work with erlang.mk. This PR fixes this issue.

Tested using this project: https://github.com/lukebakken/amqp-clients-test.git
2022-09-29 13:58:56 -07:00
Loïc Hoguin 86f3b0e83a
amqp_client's rabbit_writer shouldn't be significant
As it was not intrinsic before.
2022-09-27 13:53:09 +02:00
Michal Kuratczyk 2855278034
Migrate from supervisor2 to supervisor 2022-09-27 13:53:06 +02:00
Rin Kuryloski 34782e591c Update amqp*_client Makefiles for branch rename
For hex publishing correctness
2022-08-16 09:43:40 +02:00
Philip Kuryloski 15a79466b1 Use the new xref2 macro from rules_erlang
That adopts the modern erlang.mk xref behaviour
2022-06-09 23:18:28 +02:00
Philip Kuryloski 327f075d57 Make rabbitmq-server work with rules_erlang 3
Also rework elixir dependency handling, so we no longer rely on mix to
fetch the rabbitmq_cli deps

Also:

- Specify ra version with a commit rather than a branch
- Fixup compilation options for erlang 23
- Add missing ra reference in MODULE.bazel
- Add missing flag in oci.yaml
- Reduce bazel rbe jobs to try to save memory
- Use bazel built erlang for erlang git master tests
- Use the same cache for all the workflows but windows
- Avoid using `mix local.hex --force` in elixir rules
  - Fetching seems blocked in CI, and this should reduce hex api usage in
    all builds, which is always nice
- Remove xref and dialyze tags since rules_erlang 3 includes them in
  the defaults
2022-06-08 14:04:53 +02:00
Loïc Hoguin dc70cbf281
Update Erlang.mk and switch to new xref code 2022-05-31 13:51:12 +02:00
Michael Klishin cfb1d44920
Correct GitHub repo links in Hex metadata 2022-04-20 11:14:12 +04:00
Luke Bakken fb5068a80e
Begin work migrating to native hex publishing
Use hex for credentials_obfuscation dep
2022-04-19 13:21:52 -07:00
Luke Bakken dba25f6462
Replace files with symlinks
This prevents duplicated and out-of-date instructions.
2022-04-15 06:04:29 -07:00
Philip Kuryloski 2dd9bde891 Bring over PROJECT_APP_EXTRA_KEYS values from make to bazel 2022-04-07 17:39:33 +02:00
Philip Kuryloski a22234f6eb Updates for rules_erlang 2.5.0
rabbitmq_cli uses some private rules_erlang apis that have changed in
the upcoming release

Additionally:
- Avoid including both standard and test versions of amqp_client in
integration test suites
- Eliminate most of the compilation order hints (explicit first_srcs)
in the bazel build
- Fix an include statement - in bazel, an app is not available to
itself as a library at compilation time
2022-04-07 14:54:37 +02:00
Luke Bakken d3e15b35ff
Update amqp10_client and amqp10_common for hex.pm publish
Fixes #2577

Related rabbitmq/rabbitmq-ci#50

Yolo-copy amqp_client targets for dist

Update license short name

Remove unnecessary targets now that hex.pm exists
2022-03-29 09:54:30 -07:00
Michael Klishin c38a3d697d
Bump (c) year 2022-03-21 01:21:56 +04:00
Philip Kuryloski 226e00fcd2 Tighten up dialyzer usage
now that rules_erlang no longer cascades up dialyzer warnings from deps
2022-02-24 11:18:41 +01:00
Philip Kuryloski 1232ef2a78 Adjust test to avoid race condition and flake 2022-02-23 11:02:43 +01:00
Philip Kuryloski d8201726ae Ignore dialyzer warnings for most apps 2022-02-21 09:19:56 +01:00
Philip Kuryloski efcd881658 Use rules_erlang v2
bazel-erlang has been renamed rules_erlang. v2 is a substantial
refactor that brings Windows support. While this alone isn't enough to
run all rabbitmq-server suites on windows, one can at least now start
the broker (bazel run broker) and run the tests that do not start a
background broker process
2022-01-18 13:43:46 +01:00
Michal Kuratczyk 1a2126676d Update CLA URL 2021-09-23 14:29:36 +02:00
Philip Kuryloski 5fd9d1f638 Use Ranch 2.1.0 in bazel build
Matches 063d32626d
2021-09-10 14:46:36 +02:00
Michael Klishin 5bfbe5b8b1
Merge pull request #3233 from britto/fix-ensure-safe-call-timeout-clause
Fix typo in ensure_safe_call_timeout/2
2021-07-26 23:48:39 +03:00
João Britto a27a9fd214 Adjust initial gen_server_call_timeout
to prevent `amqp_connection:start/2` from logging a warning when we use default
values.

The default for `connection_timeout` is already 60000. When we don't explicitly
set it to a lower value, `amqp_connection:maybe_update_call_timeout/2` adjusts
it to 70000 and logs a warning message, which may appear unexpected, especially
for users upgrading to 3.8.10+ with no config changes.

This change addresses that problem by pre-adjusting it to 70000, making it safe
by default and ensuring our default values don't conflict with each other.
2021-07-26 16:59:32 -03:00
João Britto 25b6ce1d9f Fix typo in ensure_safe_call_timeout
Matching on `ignored` instead of `ignore`, as described in the documentation of
net_kernel:get_net_ticktime/0.

https://erlang.org/doc/man/net_kernel.html#get_net_ticktime-0
2021-07-26 16:54:36 -03:00
João Britto 5c69b91e15 Remove amqp_ssl:add_verify_fun_to_opts/2,3
These functions have become no-op after d76234f.

The maybe_add_verify_fun/3 function has become unreachable and was removed too.
2021-07-15 17:28:49 -03:00
Michael Klishin 29bb9c5b0c
Merge pull request #3175 from processone/proxy_protocol_tls_info
Extract TLS informations that are delivered in PROXY protocol frame
2021-07-13 15:08:40 +03:00
Philip Kuryloski 8f9de08de7 Also assert no missing suites for all other deps 2021-07-12 18:05:55 +02:00
Philip Kuryloski 3eac3cf8a8 Remove unused load statements from bazel files 2021-07-12 12:10:26 +02:00
Paweł Chmielowski d5daf7598b Extract TLS informations that are delivered in PROXY protocol frame 2021-07-05 13:29:59 +02:00
Philip Kuryloski 0ed5f325b4 Add dialyze for amqp_client 2021-05-31 10:05:03 +02:00
Philip Kuryloski 98e71c45d8 Perform xref checks on many tier-1 plugins 2021-05-21 12:03:22 +02:00
Philip Kuryloski c13c2af614 Bazel file refactoring 2021-05-11 12:03:27 +02:00
Philip Kuryloski d194341cb8 Bazel file refactoring 2021-05-11 10:44:28 +02:00
Philip Kuryloski 418cffc9f3 Add rabbit_common to the deps in rabbitmq_integration_suite macro
While not all suites strictly require it, those same suites depend on
it via the broker dependency anyway. Thus, there is no penalty, but it
shortens the BUILD.bazel file for deps/rabbit
2021-05-11 09:40:22 +02:00
Philip Kuryloski 50adab56ba Fix and refactor amqp_client bazel tests 2021-05-10 20:25:12 +02:00
Michael Klishin 5d009304fd
amqp_network_connection:handshake/3: handle socket send failures
One rabbitmq_trust_store suite runs into a badmatch on this line.
Let's return a more sensible error.
2021-04-15 13:03:15 +03:00
Philip Kuryloski 78bb20f0aa Adopt change of suite_name -> name in ct_suite from @bazel-erlang 2021-04-08 14:25:06 +02:00
Philip Kuryloski 388654c542
Add a partial Bazel build (#2938)
Adds WORKSPACE.bazel, BUILD.bazel & *.bzl files for partial build & test with Bazel. Introduces a build-time dependency on https://github.com/rabbitmq/bazel-erlang
2021-03-29 11:01:43 +02:00
Philip Kuryloski a63f169fcb Remove duplicate rabbitmq-components.mk and erlang.mk files
Also adjust the references in rabbitmq-components.mk to account for
post monorepo locations
2021-03-22 15:40:19 +01:00
kjnilsson d6e96c238c fix missing Ra deps updates 2021-03-19 13:54:43 +00:00
Michael Klishin 8b203e316e
Sync rabbitmq-components.mk in a few more places 2021-03-12 19:58:51 +03:00
Michael Klishin 97ff62d3b2
Drop trailing newlines from logged messages where possible
Lager strips trailing newline characters but OTP logger with the default
formatter adds a newline at the end. To avoid unintentional multi-line log
messages we have to revisit most messages logged.

Some log entries are intentionally multiline, others
are printed to stdout directly: newlines are required there
for sensible formatting.
2021-03-11 15:17:37 +01:00
Michael Klishin 1fc6675a42
Make this test more agnostic to stacktrace shape
The point is that both channel and connection go down,
not that a particular tuple is thrown
2021-03-09 02:48:35 +03:00
Michael Klishin a310687478
Sync rabbitmq-components.mk 2021-03-05 02:52:23 +03:00
Michael Klishin d76234f0b1
Erlang client: drop some Erlang 19-specific code 2021-03-03 18:13:49 +03:00
Michael Klishin a5098b28a7
Bump Lager to 3.8.2 for OTP 24 compatibility 2021-02-24 12:53:30 +03:00
Michael Klishin b11a79cccf
Bump (c) year in header files 2021-02-04 07:04:58 +03:00
Michael Klishin 210a032eb8
Naming 2021-01-28 18:23:38 +03:00
Luke Bakken 9048bc0c36
Fix unused variable 2021-01-28 07:16:46 -08:00
Pawel Antemijczuk 5d0aecd819 Resolve DNS until first success 2021-01-26 11:33:13 +01:00
Michael Klishin 52479099ec
Bump (c) year 2021-01-22 09:00:14 +03:00
Michael Klishin a5c8de73ce
Use ?assertEquals here 2020-12-01 06:13:10 +03:00
Michael Klishin 4c02de62ec
Wording 2020-12-01 06:12:44 +03:00
Ayanda-D 4a6bd67bc9 Add failing direct connection safe call timeout test/mock 2020-11-27 10:28:44 +00:00
Ayanda-D 0059fd7249 Add erlang client safe_call_timeouts tests 2020-11-26 17:30:18 +00:00
Ayanda-D d817c531f2 Add timeouts to direct connection establishment
operations. At some point, these have to timeout to
avoid having lingering connection processes attempting
remote connections under unstable conditions.

Improve handling of potential call timeout exceptions
in amqp_gen_connection.
2020-11-26 17:07:44 +00:00
Ayanda-D 5c469ed519 Ensure safe amqp client call timeouts on connection
establishment. This guarantees that the effective
call timeouts are always safe, i.e. granting enough
time to the underlying network operations, which must
always timeout first in case of any unexpected
lingering operations leading to timeouts. This eliminates
the chance of leaking connection processes when call
timeouts elapse, while underlying remote cconnection
establishment call was still taking place.
2020-11-26 17:02:49 +00:00
Luke Bakken 482907e1fa No longer use amqp_util:call_timeout/0 for wait_for_confirms. Allow specifying integer dimension via a tuple 2020-11-03 09:25:29 -08:00
Luke Bakken 78b1f67e75 Document the Timeout parameter to wait_for_confirms
This parameter is in seconds. Also remove superfluous `CALL_TIMEOUT` macro.

cc @dumbbell

Also see rabbitmq/rabbitmq-server#2490
2020-11-03 09:25:29 -08:00
Arnaud Cogoluègnes 76cb60ff56 Update rabbitmq-components.mk 2020-11-03 14:27:31 +01:00
Philip Kuryloski fbf08b3669 Restore the default gen_server timeout around ssl:setopts/2
amqp_main_reader:post_init/1 is invoked within
amqp_gen_connection:connect/1  with a timeout of ?CALL_TIMEOUT, so the
same timeout interval cannot be reasonably for both
2020-10-22 14:43:27 +02:00
dcorbacho 68225c6ef9 Switch to Mozilla Public License 2.0 (MPL 2.0)
(cherry picked from commit a40b700bf8453aa74819b5c4cd17b242afdd8c16)
2020-10-22 03:01:42 +03:00
Philip Kuryloski c25acbb385 Additional error handling while a connection is opened
Treat the timeout of ssl:setopts/2 as a known error when opening a connection
2020-10-21 20:47:48 +02:00
Philip Kuryloski ffb01e60c5 Be more defensive with the SSL socket when opening connections
Specifically, handle and return the error resulting from
`ssl:controlling_process/2` when opening a connection

Also increase the timeout around `ssl:setopts/2` when opening a
connection to the global client timeout
2020-10-21 16:21:20 +02:00
Michael Klishin 820793537d Update rabbitmq-components.mk 2020-10-21 12:55:27 +03:00
Luke Bakken 6c8ac0afea Take connection / channel limits into account
Starting the supervisor children could trigger a `not_allowed` if
connection or channel limits are exceeded. This change avoids the
`badmatch` error.

See:
https://github.com/rabbitmq/rabbitmq-server/runs/1243633742?check_suite_focus=true
2020-10-13 09:09:36 -07:00
Jean-Sébastien Pédron ecfe81fa3a Travis CI: Update config from rabbitmq-common 2020-10-13 17:42:48 +02:00
Jean-Sébastien Pédron 8cb9f3b02b ci: Remove unused files 2020-08-13 15:27:32 +02:00
Luke Bakken 6e40b010d2 Update rabbitmq-components.mk 2020-08-04 08:41:45 -07:00
Jean-Sébastien Pédron b55d1b16c6 Update rabbitmq-components.mk 2020-07-30 12:06:49 +02:00
Luke Bakken 367ee85743 Update rabbitmq-components.mk 2020-07-29 10:02:00 -07:00
dcorbacho e7ae2d18d7 Update erlang.mk 2020-07-21 14:31:25 +01:00
Jean-Sébastien Pédron e4d952b500 Update rabbitmq-components.mk 2020-07-21 12:07:55 +02:00
Michael Klishin 41429c5a44 Update rabbitmq-components.mk 2020-07-21 03:42:17 +03:00
dcorbacho fd34cc9b93 Revert drop of Exhibit B on MPL 2.0 2020-07-20 16:50:19 +01:00
dcorbacho 52ae0cfdb1 Update LICENSE 2020-07-20 10:39:28 +01:00
Michael Klishin b0fc2f511f Update MPL2 license file, drop Exhibit B
and add a VMware copyright notice.

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

1. https://www.mozilla.org/en-US/MPL/2.0/FAQ/
2020-07-17 14:53:10 +03:00
dcorbacho f2f2e0358b Switch to Mozilla Public License 2.0 (MPL 2.0) 2020-07-10 15:13:17 +01:00
Jean-Sébastien Pédron 0963744d8c Update erlang.mk 2020-06-23 17:12:45 +02:00
Michael Klishin 8171469eb1 Bump Recon to 2.5.1
for Erlang 23 compatibility of 'rabbitmq-diagnostics observer'

References zhongwencool/observer_cli#68.
2020-06-09 08:22:16 +03:00
Jean-Sébastien Pédron 9469ff21ed amqp_direct_connection: Use `selected_cipher_suite` instead of `cipher_suite`
... in the ssl:connection_information/1 returned proplist. `cipher_suite`
no longer exists in Erlang Git as of this commit (it is deprecated in
the documentation for quite some time). However, `selected_cipher_suite`
is supported in at least Erlang 21+, so let's use this one.
2020-05-14 11:34:46 +02:00
Gerhard Lazu 2087a45d81 Assert amqp_connection_close is OK
We want to see the value in CT logs if it's not ok.

This is in response to this test flake:
https://github.com/rabbitmq/rabbitmq-server/runs/551738403#step:5:4701

Signed-off-by: Gerhard Lazu <gerhard@lazu.co.uk>
2020-04-22 16:42:05 +01:00
Jean-Sébastien Pédron d72328ebdc Update erlang.mk 2020-04-21 16:18:12 +02:00
Michael Klishin ab1a5199dd Update unit test assertions 2020-04-01 14:06:44 +03:00
Carl Hörberg 1fc7a5e7da dont enable peer verification by default 2020-04-01 09:12:52 +02:00
Carl Hörberg dab035c6f8 enable SNI and TLS hostname verification by default 2020-03-31 23:54:28 +02:00
Jean-Sébastien Pédron d56461c038 Update copyright (year 2020) 2020-03-10 15:39:18 +01:00
Gerhard Lazu 06283c3ee4 Update rabbitmq-components.mk 2020-03-06 09:19:11 +00:00
Gerhard Lazu 02df60f532 Update erlang.mk 2020-03-06 09:16:59 +00:00
Jean-Sébastien Pédron 0e4c0ba835 Travis CI: Update config from rabbitmq-common 2020-03-04 14:24:22 +01:00
Jean-Sébastien Pédron 7013527564 Travis CI: Update config from rabbitmq-common 2020-03-04 11:17:08 +01:00
Gerhard Lazu 5d6fdab51b Update rabbitmq-components.mk 2020-02-11 15:31:40 +00:00
Michael Klishin a2589a512c (c) bump 2019-12-29 05:50:22 +03:00
Michael Klishin e8eda898fb Ignore ./sbin and ./escript 2019-12-25 00:19:32 +03:00
Michael Klishin 1595a86c34 amqp_client.gc_threshold => amqp_client.writer_gc_threshold
References #130.
2019-12-24 23:35:22 +03:00
Michael Klishin c310047f69 Introduce a fallback GC threshold value of 1GB
as used by the server.
2019-12-20 08:33:12 +03:00
Michael Klishin dfb4ff05de Bump default GC threshold to 1GB
In our testing we observe no meaningfully different peak
memory (carrier size) limit and 18 to 65% lower tail latencies
with small messages, and teen % lower with 50 MB messages.

Throughput is single digit % higher.

CPU usage was not meaningfully different on a four core host.

References rabbitmq/rabbitmq-common#343.
2019-12-20 08:02:50 +03:00
Michael Klishin 472bde25c7 Merge branch 'configurable_gc_threshold' of https://github.com/nyczol/rabbitmq-erlang-client into nyczol-configurable_gc_threshold 2019-12-20 03:34:38 +03:00
Jean-Sébastien Pédron 330172ce60 Update rabbitmq-components.mk 2019-12-12 13:14:50 +01:00
ANycz 3d42da42c6 make garbage collector threshold configurable 2019-12-11 22:13:50 +01:00