Skip to content

Commit 50ac865

Browse files
Merge branch 'master' into management-only-api
2 parents e151ebf + d35182b commit 50ac865

28 files changed

+1537
-435
lines changed

erlang.mk

Lines changed: 756 additions & 331 deletions
Large diffs are not rendered by default.

include/amqqueue.hrl

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,15 @@
6565

6666
-define(amqqueue_has_valid_pid(Q),
6767
((?is_amqqueue_v2(Q) andalso
68-
is_pid(?amqqueue_v2_field_pid(Q))) orelse
69-
(?is_amqqueue_v1(Q) andalso
70-
is_pid(?amqqueue_v1_field_pid(Q))))).
68+
is_pid(?amqqueue_v2_field_pid(Q))) orelse
69+
(?is_amqqueue_v1(Q) andalso
70+
is_pid(?amqqueue_v1_field_pid(Q))))).
7171

7272
-define(amqqueue_pid_runs_on_local_node(Q),
7373
((?is_amqqueue_v2(Q) andalso
74-
node(?amqqueue_v2_field_pid(Q)) =:= node()) orelse
75-
(?is_amqqueue_v1(Q) andalso
76-
node(?amqqueue_v1_field_pid(Q)) =:= node()))).
74+
node(?amqqueue_v2_field_pid(Q)) =:= node()) orelse
75+
(?is_amqqueue_v1(Q) andalso
76+
node(?amqqueue_v1_field_pid(Q)) =:= node()))).
7777

7878
-define(amqqueue_pid_equals(Q, Pid),
7979
((?is_amqqueue_v2(Q) andalso
@@ -108,9 +108,9 @@
108108

109109
-define(amqqueue_vhost_equals(Q, VHost),
110110
((?is_amqqueue_v2(Q) andalso
111-
?amqqueue_v2_vhost(Q) =:= VHost) orelse
112-
(?is_amqqueue_v1(Q) andalso
113-
?amqqueue_v1_vhost(Q) =:= VHost))).
111+
?amqqueue_v2_vhost(Q) =:= VHost) orelse
112+
(?is_amqqueue_v1(Q) andalso
113+
?amqqueue_v1_vhost(Q) =:= VHost))).
114114

115115
-ifdef(DEBUG_QUORUM_QUEUE_FF).
116116
-define(enable_quorum_queue_if_debug,

priv/schema/rabbit.schema

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,13 @@ end}.
391391
{datatype, integer}
392392
]}.
393393

394+
%% Default worker process pool size. Used to limit maximum concurrency rate
395+
%% of certain operations, e.g. queue initialisation and recovery on node boot.
396+
397+
{mapping, "default_worker_pool_size", "rabbit.default_worker_pool_size", [
398+
{datatype, integer}, {validators, ["non_negative_integer"]}
399+
]}.
400+
394401
%% Password hashing implementation. Will only affect newly
395402
%% created users. To recalculate hash for an existing user
396403
%% it's necessary to update her password.

rabbitmq-components.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,15 @@ RABBITMQ_COMPONENTS = amqp_client \
184184
rabbitmq_web_stomp_examples \
185185
rabbitmq_website
186186

187+
# Erlang.mk does not rebuild dependencies by default, once they were
188+
# compiled once, except for those listed in the `$(FORCE_REBUILD)`
189+
# variable.
190+
#
191+
# We want all RabbitMQ components to always be rebuilt: this eases
192+
# the work on several components at the same time.
193+
194+
FORCE_REBUILD = $(RABBITMQ_COMPONENTS)
195+
187196
# Several components have a custom erlang.mk/build.config, mainly
188197
# to disable eunit. Therefore, we can't use the top-level project's
189198
# erlang.mk copy.

scripts/rabbitmq-server

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ RABBITMQ_DIST_PORT=$RABBITMQ_DIST_PORT \
194194
-noinput \
195195
-hidden \
196196
-s rabbit_prelaunch \
197+
${RABBITMQ_SERVER_ADDITIONAL_ERL_ARGS} \
197198
${RABBITMQ_NAME_TYPE} ${RABBITMQ_PRELAUNCH_NODENAME} \
198199
-conf_advanced "${RABBITMQ_ADVANCED_CONFIG_FILE}" \
199200
-rabbit feature_flags_file "\"$RABBITMQ_FEATURE_FLAGS_FILE\"" \

src/amqqueue.erl

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@
1919
-include_lib("rabbit_common/include/rabbit.hrl").
2020
-include("amqqueue.hrl").
2121

22-
-export([new/9,
22+
-export([new/8,
23+
new/9,
24+
new_with_version/9,
2325
new_with_version/10,
2426
fields/0,
2527
fields/1,
@@ -177,6 +179,40 @@
177179
amqqueue_v2_pattern/0,
178180
ra_server_id/0]).
179181

182+
-spec new(rabbit_amqqueue:name(),
183+
pid() | ra_server_id() | none,
184+
boolean(),
185+
boolean(),
186+
pid() | none,
187+
rabbit_framing:amqp_table(),
188+
rabbit_types:vhost() | undefined,
189+
map()) -> amqqueue().
190+
191+
new(#resource{kind = queue} = Name,
192+
Pid,
193+
Durable,
194+
AutoDelete,
195+
Owner,
196+
Args,
197+
VHost,
198+
Options)
199+
when (is_pid(Pid) orelse is_tuple(Pid) orelse Pid =:= none) andalso
200+
is_boolean(Durable) andalso
201+
is_boolean(AutoDelete) andalso
202+
(is_pid(Owner) orelse Owner =:= none) andalso
203+
is_list(Args) andalso
204+
(is_binary(VHost) orelse VHost =:= undefined) andalso
205+
is_map(Options) ->
206+
new(Name,
207+
Pid,
208+
Durable,
209+
AutoDelete,
210+
Owner,
211+
Args,
212+
VHost,
213+
Options,
214+
?amqqueue_v1_type).
215+
180216
-spec new(rabbit_amqqueue:name(),
181217
pid() | ra_server_id() | none,
182218
boolean(),
@@ -229,6 +265,44 @@ new(#resource{kind = queue} = Name,
229265
Options)
230266
end.
231267

268+
-spec new_with_version
269+
(amqqueue_v1 | amqqueue_v2,
270+
rabbit_amqqueue:name(),
271+
pid() | ra_server_id() | none,
272+
boolean(),
273+
boolean(),
274+
pid() | none,
275+
rabbit_framing:amqp_table(),
276+
rabbit_types:vhost() | undefined,
277+
map()) -> amqqueue().
278+
279+
new_with_version(RecordVersion,
280+
#resource{kind = queue} = Name,
281+
Pid,
282+
Durable,
283+
AutoDelete,
284+
Owner,
285+
Args,
286+
VHost,
287+
Options)
288+
when (is_pid(Pid) orelse is_tuple(Pid) orelse Pid =:= none) andalso
289+
is_boolean(Durable) andalso
290+
is_boolean(AutoDelete) andalso
291+
(is_pid(Owner) orelse Owner =:= none) andalso
292+
is_list(Args) andalso
293+
(is_binary(VHost) orelse VHost =:= undefined) andalso
294+
is_map(Options) ->
295+
new_with_version(RecordVersion,
296+
Name,
297+
Pid,
298+
Durable,
299+
AutoDelete,
300+
Owner,
301+
Args,
302+
VHost,
303+
Options,
304+
?amqqueue_v1_type).
305+
232306
-spec new_with_version
233307
(amqqueue_v1 | amqqueue_v2,
234308
rabbit_amqqueue:name(),
@@ -359,6 +433,8 @@ get_exclusive_owner(#amqqueue{exclusive_owner = Owner}) ->
359433
get_exclusive_owner(Queue) ->
360434
amqqueue_v1:get_exclusive_owner(Queue).
361435

436+
% gm_pids
437+
362438
-spec get_gm_pids(amqqueue()) -> [{pid(), pid()} | pid()] | none.
363439

364440
get_gm_pids(#amqqueue{gm_pids = GMPids}) ->
@@ -421,7 +497,7 @@ get_pid(#amqqueue{pid = Pid}) -> Pid;
421497
get_pid(Queue) -> amqqueue_v1:get_pid(Queue).
422498

423499
-spec set_pid
424-
(amqqueue_v2(), pid() | ra_server_id() | none) -> amqqueue_v2();
500+
(amqqueue_v2(), pid() | ra_server_id() | none) -> amqqueue_v2();
425501
(amqqueue_v1:amqqueue_v1(), pid() | none) -> amqqueue_v1:amqqueue_v1().
426502

427503
set_pid(#amqqueue{} = Queue, Pid) ->
@@ -509,7 +585,8 @@ set_slave_pids(Queue, SlavePids) ->
509585

510586
-spec get_slave_pids_pending_shutdown(amqqueue()) -> [pid()].
511587

512-
get_slave_pids_pending_shutdown(#amqqueue{slave_pids_pending_shutdown = Slaves}) ->
588+
get_slave_pids_pending_shutdown(
589+
#amqqueue{slave_pids_pending_shutdown = Slaves}) ->
513590
Slaves;
514591
get_slave_pids_pending_shutdown(Queue) ->
515592
amqqueue_v1:get_slave_pids_pending_shutdown(Queue).

0 commit comments

Comments
 (0)