Skip to content

Commit 83e5c6c

Browse files
Merge branch 'main' into rabbitmq-server-7743-unblock-super-stream-partition-consumer-group
2 parents 9285ce4 + a458076 commit 83e5c6c

File tree

2 files changed

+64
-17
lines changed

2 files changed

+64
-17
lines changed

deps/rabbit/src/rabbit_reader.erl

+23-17
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@
6666
-record(v1, {
6767
%% parent process
6868
parent,
69+
%% Ranch ref
70+
ranch_ref,
6971
%% socket
7072
sock,
7173
%% connection state, see connection record
@@ -162,7 +164,7 @@ init(Parent, HelperSup, Ref) ->
162164
{ok, Sock} = rabbit_networking:handshake(Ref,
163165
application:get_env(rabbit, proxy_protocol, false)),
164166
Deb = sys:debug_options([]),
165-
start_connection(Parent, HelperSup, Deb, Sock).
167+
start_connection(Parent, HelperSup, Ref, Deb, Sock).
166168

167169
-spec system_continue(_,_,{[binary()], non_neg_integer(), #v1{}}) -> any().
168170

@@ -289,10 +291,10 @@ socket_op(Sock, Fun) ->
289291
exit(normal)
290292
end.
291293

292-
-spec start_connection(pid(), pid(), any(), rabbit_net:socket()) ->
294+
-spec start_connection(pid(), pid(), ranch:ref(), any(), rabbit_net:socket()) ->
293295
no_return().
294296

295-
start_connection(Parent, HelperSup, Deb, Sock) ->
297+
start_connection(Parent, HelperSup, RanchRef, Deb, Sock) ->
296298
process_flag(trap_exit, true),
297299
RealSocket = rabbit_net:unwrap_socket(Sock),
298300
Name = case rabbit_net:connection_string(Sock, inbound) of
@@ -310,6 +312,7 @@ start_connection(Parent, HelperSup, Deb, Sock) ->
310312
socket_op(Sock, fun (S) -> rabbit_net:socket_ends(S, inbound) end),
311313
?store_proc_name(Name),
312314
State = #v1{parent = Parent,
315+
ranch_ref = RanchRef,
313316
sock = RealSocket,
314317
connection = #connection{
315318
name = Name,
@@ -1209,16 +1212,16 @@ handle_method0(#'connection.tune_ok'{frame_max = FrameMax,
12091212
heartbeater = Heartbeater};
12101213

12111214
handle_method0(#'connection.open'{virtual_host = VHost},
1212-
State = #v1{connection_state = opening,
1215+
State = #v1{ranch_ref = RanchRef,
1216+
connection_state = opening,
12131217
connection = Connection = #connection{
12141218
log_name = ConnName,
1215-
port = Port,
12161219
user = User = #user{username = Username},
12171220
protocol = Protocol},
12181221
helper_sup = SupPid,
12191222
sock = Sock,
12201223
throttle = Throttle}) ->
1221-
ok = is_over_node_connection_limit(Port),
1224+
ok = is_over_node_connection_limit(RanchRef),
12221225
ok = is_over_vhost_connection_limit(VHost, User),
12231226
ok = is_over_user_connection_limit(User),
12241227
ok = rabbit_access_control:check_vhost_access(User, VHost, {socket, Sock}, #{}),
@@ -1319,18 +1322,21 @@ is_vhost_alive(VHostPath, User) ->
13191322
[VHostPath, User#user.username, VHostPath])
13201323
end.
13211324

1322-
is_over_node_connection_limit(Port) ->
1323-
{Addr, _, _} = hd(rabbit_networking:tcp_listener_addresses(Port)),
1324-
Ref = rabbit_networking:ranch_ref(Addr, Port),
1325-
#{active_connections := ActiveConns} = ranch:info(Ref),
1325+
is_over_node_connection_limit(RanchRef) ->
13261326
Limit = rabbit_misc:get_env(rabbit, connection_max, infinity),
1327-
case ActiveConns > Limit of
1328-
false -> ok;
1329-
true ->
1330-
rabbit_misc:protocol_error(not_allowed,
1331-
"connection refused: "
1332-
"node connection limit (~tp) is reached",
1333-
[Limit])
1327+
case Limit of
1328+
infinity -> ok;
1329+
N when is_integer(N) ->
1330+
#{active_connections := ActiveConns} = ranch:info(RanchRef),
1331+
1332+
case ActiveConns > Limit of
1333+
false -> ok;
1334+
true ->
1335+
rabbit_misc:protocol_error(not_allowed,
1336+
"connection refused: "
1337+
"node connection limit (~tp) is reached",
1338+
[Limit])
1339+
end
13341340
end.
13351341

13361342
is_over_vhost_connection_limit(VHostPath, User) ->

release-notes/3.11.13.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
RabbitMQ `3.11.13` is a maintenance release in the `3.11.x` [release series](https://www.rabbitmq.com/versions.html).
2+
3+
Please refer to the upgrade section from [v3.11.0 release notes](https://github.com/rabbitmq/rabbitmq-server/releases/tag/v3.11.0)
4+
if upgrading from a version prior to 3.11.0.
5+
6+
This release requires Erlang 25.
7+
[RabbitMQ and Erlang/OTP Compatibility Matrix](https://www.rabbitmq.com/which-erlang.html) has more details on
8+
Erlang version requirements for RabbitMQ.
9+
10+
11+
### Minimum Supported Erlang Version
12+
13+
As of 3.11.0, RabbitMQ requires Erlang 25. Nodes **will fail to start** on older Erlang releases.
14+
15+
Erlang 25 as our new baseline means much improved performance on ARM64 architectures, [profiling with flame graphs](https://blog.rabbitmq.com/posts/2022/05/flame-graphs/)
16+
across all architectures, and the most recent TLS 1.3 implementation available to all RabbitMQ 3.11 users.
17+
18+
19+
## Changes Worth Mentioning
20+
21+
Release notes can be found on GitHub at [rabbitmq-server/release-notes](https://github.com/rabbitmq/rabbitmq-server/tree/v3.11.x/release-notes).
22+
23+
### Core Server
24+
25+
#### Bug Fixes
26+
27+
* `3.11.12` introduced a regression that caused client connections to fail with an exception
28+
when TCP or TLS listeners were bould to a particular interface.
29+
30+
GitHub issue: [#7788](https://github.com/rabbitmq/rabbitmq-server/pull/7788)
31+
32+
33+
## Dependency Upgrades
34+
35+
None in this release.
36+
37+
38+
## Source Code Archives
39+
40+
To obtain source code of the entire distribution, please download the archive named `rabbitmq-server-3.11.13.tar.xz`
41+
instead of the source tarball produced by GitHub.

0 commit comments

Comments
 (0)