Commit Graph

49842 Commits

Author SHA1 Message Date
Luke Bakken 6de0656fce
Add redbug library
`redbug` compliments `recon` well and has a better tracing interface IMHO.
2022-01-11 16:22:05 -08:00
Michael Klishin c9c03d275c
Merge pull request #3980 from rabbitmq/gh-3936-followup
Replace one use of filelib:is_regular/1
2022-01-11 22:13:05 +03:00
Luke Bakken 95a60fc3be
Replace one use of filelib:is_regular/1
This specific case is called multiple times by the Prometheus plugin. It eventually calls `file:read_file_info/1` which leaks on Windows

See #3936
2022-01-11 09:08:34 -08:00
Philip Kuryloski 06d7c3fa84 GitHub Actions updates for the new v3.10.x branch 2022-01-11 16:47:46 +01:00
Michael Klishin 98539b9852
Merge pull request #3970 from rabbitmq/gh-3895-bugfix
Fix issue with fsutil
2022-01-11 01:15:49 +03:00
Luke Bakken fd781441f3
Fix issue with fsutil
Fsutil has language-specific messages. Fix by using powershell.exe instead.

Follow-up to #3895

Reported here:
https://groups.google.com/g/rabbitmq-users/c/ypk51AtmrSM
2022-01-08 05:37:41 -08:00
Michael Klishin 4a3d92677c
Merge pull request #3967 from rabbitmq/tomyouyou-stream_select_leader
Fix Stream coordinator leader selection bug
2022-01-08 02:34:28 +03:00
Karl Nilsson 82470e9d1c Stream coordinator: handle machine_version command 2022-01-07 12:30:03 +00:00
Karl Nilsson 9a5d0f9d85 Make stream coodinator machine versioned
In order to retain deterministic results of state machine applications
during upgrades we need to make the stream coordinator versioned such
that we only use the new logic once the stream coordinator switches to
machine version 1.
2022-01-07 12:11:11 +00:00
tomyouyou e5ccf267ff 'rabbit_stream_coordinator:select_leader' runs with wrong comparison
The list consists of candidates which is a tuple {node, tail}, and the tail is made of {epoch, offset}.
While the 'select_leader' think the tail is made of {offset, epoch}. 

Suppose there are two candidates:
[{node1,{1,100}},{node2,{2,99}}] 

It selects node1 as the leader instead of node2 with larger epoch.
2022-01-07 10:06:16 +00:00
Michael Klishin 8e2edc76c2
Revert "Fix the sha and prefix for bazel-erlang based on the repo rename"
This reverts commit 9a0d448d34.
2022-01-06 01:10:57 +03:00
Philip Kuryloski 9a0d448d34
Fix the sha and prefix for bazel-erlang based on the repo rename
(cherry picked from commit 0a731b7074)
2022-01-06 00:56:53 +03:00
Michael Klishin 7787fe2780
Revert "Update Bazel rules repository name"
This reverts commit 371b44dcf2.
2022-01-05 19:06:37 +03:00
Michael Klishin 371b44dcf2
Update Bazel rules repository name 2022-01-05 18:58:02 +03:00
Michael Klishin 5a07f728c3
Merge pull request #3956 from tomyouyou/record_dist_ip
Distribution listener IP address is hardcoded in listener metadata
2022-01-05 17:38:35 +04:00
Michael Klishin e341f02cc4
Merge pull request #3957 from rabbitmq/rollback-rebar3_hex-version
Limit the version of rebar3_hex to v6
2022-01-05 17:02:15 +04:00
Philip Kuryloski 135128e929 Limit the version of rebar3_hex to v6
v7 introduces changes that break pipelines -
https://github.com/rabbitmq/hexpm-cli/issues/3

It would be better to drop hexpm-cli and use the hex publishing
support present in newer versions of erlang.mk
2022-01-05 11:08:18 +01:00
tomyouyou fac249b755
The wrong distribution listener IP address is recorded when it is configured.
Add an item to the configuration file(/etc/rabbitmq/rabbitmq.config):
{kernel, [{inet_dist_use_interface, {8193,291,0,0,0,0,0,1}}]}

Use the netstat command to check the IP address of the distribution port(25672):
netstat -anp | grep 25672
tcp6       0      0 2001:123::1:25672       :::*                    LISTEN      2075/beam.smp

However, 'rabbitmqctl status' shows:
...
Interface: [::], port: 25672, protocol: clustering, purpose: inter-node and CLI tool communication
...
2022-01-05 16:03:24 +08:00
Michael Klishin fff86d75f7
Merge pull request #3953 from rabbitmq/mk-bump-copyright-year
Bump (c) year in node startup banner
2022-01-05 09:04:13 +04:00
Michael Klishin d2e0fae1aa
Bump (c) year in node startup banner 2022-01-05 09:03:46 +04:00
Michael Klishin bbd524f327
Merge pull request #3952 from rabbitmq/mk-3.8.27-release-notes
3.8.27 release notes
2022-01-04 19:11:57 +04:00
Michael Klishin 2900765e32
3.8.27 release notes 2022-01-04 19:11:22 +04:00
Michael Klishin 53a8732caf
Update 3.9.12.md 2022-01-04 18:08:45 +03:00
Michael Klishin 020230c97f
Merge pull request #3950 from rabbitmq/mk-3.9.12-release-notes
3.9.12 release notes
2022-01-04 18:17:09 +04:00
Michael Klishin 6c29e2a36c
3.9.12 release notes 2022-01-04 18:16:26 +04:00
Michael Klishin ece78e78e5
Merge pull request #3947 from skorzhevsky/fix-readme-in-auth-backend-cache
Fix config example in README.md for rabbitmq_auth_backend_cache
2022-01-04 16:41:47 +04:00
skorzhevsky ec1ee0c011
Fix config example in README.md for rabbitmq_auth_backend_cache 2022-01-04 14:30:04 +03:00
Michael Klishin c75ac14efa
Merge pull request #3936 from rabbitmq/lukebakken/fix-all-read-file
Fix all uses of file:read_file/1
2022-01-04 12:46:34 +04:00
Philip Kuryloski 12f58beb04
Merge pull request #3941 from rabbitmq/bazel-run-dev-broker
Disable +deterministic in compilation_mode dbg under bazel
2022-01-04 09:30:15 +01:00
Luke Bakken 7f0285834e
Fix all uses of file:read_file/1
This is to address another memory leak on win32 reported here:

https://groups.google.com/g/rabbitmq-users/c/UE-wxXerJl8

"RabbitMQ constant memory increase (binary_alloc) in idle state"

The root cause is the Prometheus plugin making repeated calls to `rabbit_misc:otp_version/0` which then calls `file:read_file/1` and leaks memory on win32.

See https://github.com/erlang/otp/issues/5527 for the report to the Erlang team.

Turn `badmatch` into actual error
2022-01-03 11:33:36 -08:00
dcorbacho 0bd8d41b72 Skip new import testcase on mixed environments 2022-01-03 17:37:06 +01:00
Philip Kuryloski 70ef6b6984 Disable +deterministic in compilation_mode dbg under bazel
This allows compiling and reloading code from the erlang shell when
running the broker with `bazel run -c dbg broker`
2022-01-03 12:38:06 +01:00
Michael Klishin 457b0c5c32
Merge pull request #3934 from rabbitmq/decode-method-fields
Reduce CPU usage of rabbit_framing_amqp_0_9_1:decode_method_fields/2
2022-01-01 07:16:37 +03:00
David Ansari e10247feee Reduce CPU usage of rabbit_framing_amqp_0_9_1:decode_method_fields/2
This diff will generate module rabbit_framing_amqp_0_9_1 with
re-ordered clauses of function decode_method_fields/2.

After this change, basic class will be at the top of the function
clauses. That's better because for example basic.publish and basic.ack
are called far more often than for example methods of class connection,
channel or exchange.

Note that "the compiler does not rearrange clauses that match binaries."
See https://www.erlang.org/doc/efficiency_guide/functions.html#pattern-matching

Measurement taken on an Ubuntu 20.04 VM before and after this change:
1. Install latest Erlang from master (i.e. Erlang 25)
2. RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS="+JPperf true +S 1" make run-broker
   (Single scheduler makes the flame graph easier to read.)
3. Run rabbitmq-perf-test without any parameters
4. sudo perf record -g -F 9999 -p <pid> -- sleep 5
   where <pid> is the output of 'os:getpid().' (in the Erlang shell).
   This samples CPU stack traces via frame pointers of
   rabbitmq-server at 9999 Hertz for 5 seconds.
5. Generate a differential flame graph as described in
   https://www.brendangregg.com/blog/2014-11-09/differential-flame-graphs.html

Before this change, stack frame rabbit_framing_amqp_0_9_1:decode_method_fields/2
was 1.57% present in all stack trackes, most of the time (> 1%) running
on the CPU, i.e. directly consuming CPU cycles.
This does not sound like a lot, but is actually quite a lot for a single
function!

The diffential flame graph depicts a single dark blue frame: function decode_method_fields
with a reduction of ~0.85%.
2021-12-31 02:26:21 +01:00
Michael Klishin 4993fefa08
#3925 follow-up: add a rabbit_common Bazel dep 2021-12-28 01:30:07 +03:00
Michael Klishin 19ae35aa14
#3925 follow-up: don't include Erlang client headers 2021-12-28 01:24:32 +03:00
Michael Klishin 7ded41f26a
#3925 follow-up: update Bazel files to match new suite names 2021-12-28 01:19:00 +03:00
Michael Klishin a29a68a632
Merge branch 'thuandb-master' 2021-12-28 00:36:22 +03:00
Michael Klishin b569ab5d74
Rename two newly introduced test modules 2021-12-28 00:35:55 +03:00
Michael Klishin dfa730b737
delegate: documentation edits 2021-12-26 04:32:00 +03:00
Michael Klishin 202f881601
Make xref happy 2021-12-26 04:32:00 +03:00
dcorbacho c88605aab4
Import definitions: support user limits 2021-12-26 04:32:00 +03:00
Michael Klishin 5d2a735ae7
Cosmetics 2021-12-26 04:32:00 +03:00
Lajos Gerecs c972f07816
wrap authentication calls in try catch to avoid leaking error 2021-12-26 04:32:00 +03:00
Luke Bakken d1496a2c7c
Fix tests 2021-12-26 04:32:00 +03:00
Luke Bakken 043641c99f
Use protected ets so that data can be read quickly 2021-12-26 04:31:59 +03:00
Luke Bakken eecfa0a1e9
Clarify warning message 2021-12-26 04:31:59 +03:00
Luke Bakken fe8ae3c713
Restore old win32 free disk query using `dir` as a last resort 2021-12-26 04:31:59 +03:00
Luke Bakken c6271a90a0
Be smarter about extracting the drive letter from a directory on win32 2021-12-26 04:31:59 +03:00
Luke Bakken 6200887f84
Disk monitor improvements
Related to VESC-1015

* Remove `infinity` timeouts
* Improve free disk space retrieval on win32

Run commands with a timeout

This PR fixes an issue I observed while reproducing VESC-1015 on Windows
10. Within an hour or so of running a 3-node cluster that has health
checks being run against it, one or more nodes' memory use would spike.
I would see that the rabbit_disk_monitor process is stuck executing
os:cmd to retrieve free disk space information. Thus, all
gen_server:call calls to the process would never return, especially
since they used an infinity timeout.

Do something with timeout

Fix unit_disk_monitor_mocks_SUITE
2021-12-26 04:31:59 +03:00