Skip to content

Commit 7521ab4

Browse files
Merge branch 'master' into rabbitmq-server-1873-binding-recovery
2 parents 76c7a01 + 414b75c commit 7521ab4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+112
-124
lines changed

docs/rabbitmq-service.8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Defaults to
115115
for 64-bit environments).
116116
This is the installation location of the Erlang service manager.
117117
.It Ev RABBITMQ_CONSOLE_LOG
118-
Set this varable to
118+
Set this variable to
119119
.Sy new or
120120
.Sy reuse
121121
to have the console output from the server redirected to a file named

docs/rabbitmq.conf.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@
804804
## See http://rabbitmq.com/logging.html and https://github.com/erlang-lager/lager for details.
805805
##
806806

807-
## Log direcrory, taken from the RABBITMQ_LOG_BASE env variable by default.
807+
## Log directory, taken from the RABBITMQ_LOG_BASE env variable by default.
808808
##
809809
# log.dir = /var/log/rabbitmq
810810

docs/rabbitmq.config.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@
339339

340340
%% Enables flow control between queue mirrors.
341341
%% Disabling this can be dangerous and is not recommended.
342-
%% When flow control is disablied, queue masters can outpace mirrors and not allow mirrors to catch up.
342+
%% When flow control is disabled, queue masters can outpace mirrors and not allow mirrors to catch up.
343343
%% Mirrors will end up using increasingly more RAM, eventually triggering a memory alarm.
344344
%%
345345
%% {mirroring_flow_control, true},
@@ -909,7 +909,7 @@
909909
%% {rabbit_channel_lager_event, [{handlers, [
910910
%% {lager_forwarder_backend,
911911
%% [lager_event, info]}]}]},
912-
%% {rabbit_conection_lager_event, [{handlers, [
912+
%% {rabbit_connection_lager_event, [{handlers, [
913913
%% {lager_forwarder_backend,
914914
%% [lager_event, info]}]}]},
915915
%% {rabbit_mirroring_lager_event, [{handlers, [

docs/rabbitmqctl.8

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ To use this precompiled files, you should set
156156
.Ev RABBITMQ_SERVER_CODE_PATH
157157
environment variable to directory specified in
158158
.Cm hipe_compile
159-
invokation.
159+
invocation.
160160
.Pp
161161
For example, to HiPE-compile modules and store them to
162162
.Pa /tmp/rabbit-hipe/ebin
@@ -255,7 +255,7 @@ For example, to instruct the RabbitMQ node to terminate:
255255
.Dl rabbitmqctl stop
256256
.\" ------------------------------------
257257
.It Cm stop_app
258-
Stops the RabbitMQ application, leaving the runtme (Erlang VM) running.
258+
Stops the RabbitMQ application, leaving the runtime (Erlang VM) running.
259259
.Pp
260260
This command is typically run prior to performing other management
261261
actions that require the RabbitMQ application to be stopped, e.g.\&

erlang.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,7 +596,7 @@ pkg_check_node_commit = master
596596

597597
PACKAGES += chronos
598598
pkg_chronos_name = chronos
599-
pkg_chronos_description = Timer module for Erlang that makes it easy to abstact time out of the tests.
599+
pkg_chronos_description = Timer module for Erlang that makes it easy to abstract time out of the tests.
600600
pkg_chronos_homepage = https://github.com/lehoff/chronos
601601
pkg_chronos_fetch = git
602602
pkg_chronos_repo = https://github.com/lehoff/chronos
@@ -1340,7 +1340,7 @@ pkg_erlang_cep_commit = master
13401340

13411341
PACKAGES += erlang_js
13421342
pkg_erlang_js_name = erlang_js
1343-
pkg_erlang_js_description = A linked-in driver for Erlang to Mozilla's Spidermonkey Javascript runtime.
1343+
pkg_erlang_js_description = A linked-in driver for Erlang to Mozilla's Spidermonkey JavaScript runtime.
13441344
pkg_erlang_js_homepage = https://github.com/basho/erlang_js
13451345
pkg_erlang_js_fetch = git
13461346
pkg_erlang_js_repo = https://github.com/basho/erlang_js
@@ -4132,7 +4132,7 @@ pkg_yaws_commit = master
41324132

41334133
PACKAGES += zab_engine
41344134
pkg_zab_engine_name = zab_engine
4135-
pkg_zab_engine_description = zab propotocol implement by erlang
4135+
pkg_zab_engine_description = zab protocol implement by erlang
41364136
pkg_zab_engine_homepage = https://github.com/xinmingyao/zab_engine
41374137
pkg_zab_engine_fetch = git
41384138
pkg_zab_engine_repo = https://github.com/xinmingyao/zab_engine

priv/schema/rabbit.schema

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -903,7 +903,7 @@ fun(Conf) ->
903903
end
904904
end}.
905905

906-
%% Classic config-driven peer discuvery backend.
906+
%% Classic config-driven peer discovery backend.
907907
%%
908908
%% Make clustering happen *automatically* at startup - only applied
909909
%% to nodes that have just been reset or started for the first time.
@@ -1530,7 +1530,7 @@ fun(Size) when is_integer(Size) ->
15301530
Size > 0 andalso Size < 536870912
15311531
end}.
15321532

1533-
{validator, "less_than_1", "Flooat is not beetween 0 and 1",
1533+
{validator, "less_than_1", "Float is not between 0 and 1",
15341534
fun(Float) when is_float(Float) ->
15351535
Float > 0 andalso Float < 1
15361536
end}.

rabbitmq-components.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ export base_rmq_ref
226226
# If cloning from this computed location fails, we fallback to RabbitMQ
227227
# upstream which is GitHub.
228228

229-
# Maccro to transform eg. "rabbit_common" to "rabbitmq-common".
229+
# Macro to transform eg. "rabbit_common" to "rabbitmq-common".
230230
rmq_cmp_repo_name = $(word 2,$(dep_$(1)))
231231

232232
# Upstream URL for the current project.

scripts/rabbitmq-server

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ fi
219219
# The defaults are meant to reduce RabbitMQ's memory usage and help
220220
# it reclaim memory at the cost of a slight decrease in performance
221221
# (due to an increase in memory operations). These defaults can be
222-
# overriden using the RABBITMQ_SERVER_ERL_ARGS variable.
222+
# overridden using the RABBITMQ_SERVER_ERL_ARGS variable.
223223
RABBITMQ_DEFAULT_ALLOC_ARGS="+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30"
224224

225225
${ERL_DIR}erl ${RABBITMQ_DEFAULT_ALLOC_ARGS} \
@@ -374,7 +374,7 @@ else
374374
# This is considered an abnormal process termination. Normally, we
375375
# don't need to specify this exit code because the shell propagates it.
376376
# Unfortunately, the signal handler doesn't work as expected in Dash,
377-
# thus we need to explicitely restate the exit code.
377+
# thus we need to explicitly restate the exit code.
378378
trap "stop_rabbitmq_server; exit 0" HUP TERM TSTP
379379
trap "stop_rabbitmq_server; exit 130" INT
380380

scripts/rabbitmq-server.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ rem
167167
rem The defaults are meant to reduce RabbitMQ's memory usage and help
168168
rem it reclaim memory at the cost of a slight decrease in performance
169169
rem (due to an increase in memory operations). These defaults can be
170-
rem overriden using the RABBITMQ_SERVER_ERL_ARGS variable.
170+
rem overridden using the RABBITMQ_SERVER_ERL_ARGS variable.
171171

172172
set RABBITMQ_DEFAULT_ALLOC_ARGS=+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30
173173

scripts/rabbitmq-service.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ rem
254254
rem The defaults are meant to reduce RabbitMQ's memory usage and help
255255
rem it reclaim memory at the cost of a slight decrease in performance
256256
rem (due to an increase in memory operations). These defaults can be
257-
rem overriden using the RABBITMQ_SERVER_ERL_ARGS variable.
257+
rem overridden using the RABBITMQ_SERVER_ERL_ARGS variable.
258258

259259
set RABBITMQ_DEFAULT_ALLOC_ARGS=+MBas ageffcbf +MHas ageffcbf +MBlmbcs 512 +MHlmbcs 512 +MMmcs 30
260260

src/amqqueue.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
%% implicit
108108
%% update
109109
%% as above
110-
gm_pids = [] :: [pid()] | none | '_', %% transient
110+
gm_pids = [] :: [{pid(), pid()} | pid()] | none | '_', %% transient
111111
decorators :: [atom()] | none | undefined | '_', %% transient,
112112
%% recalculated
113113
%% as above
@@ -359,14 +359,14 @@ get_exclusive_owner(#amqqueue{exclusive_owner = Owner}) ->
359359
get_exclusive_owner(Queue) ->
360360
amqqueue_v1:get_exclusive_owner(Queue).
361361

362-
-spec get_gm_pids(amqqueue()) -> [pid()] | none.
362+
-spec get_gm_pids(amqqueue()) -> [{pid(), pid()} | pid()] | none.
363363

364364
get_gm_pids(#amqqueue{gm_pids = GMPids}) ->
365365
GMPids;
366366
get_gm_pids(Queue) ->
367367
amqqueue_v1:get_gm_pids(Queue).
368368

369-
-spec set_gm_pids(amqqueue(), [pid()] | none) -> amqqueue().
369+
-spec set_gm_pids(amqqueue(), [{pid(), pid()} | pid()] | none) -> amqqueue().
370370

371371
set_gm_pids(#amqqueue{} = Queue, GMPids) ->
372372
Queue#amqqueue{gm_pids = GMPids};

src/gm.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ neighbour_cast(N, Msg) -> ?INSTR_MOD:cast(get_pid(N), Msg).
12711271
neighbour_call(N, Msg) -> ?INSTR_MOD:call(get_pid(N), Msg, infinity).
12721272

12731273
%% ---------------------------------------------------------------------------
1274-
%% View monitoring and maintanence
1274+
%% View monitoring and maintenance
12751275
%% ---------------------------------------------------------------------------
12761276

12771277
ensure_neighbour(_Ver, Self, {Self, undefined}, Self) ->

src/lager_exchange_backend.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,8 @@ handle_log_event({log, Message},
165165
headers = Headers},
166166
Body = rabbit_data_coercion:to_binary(Formatter:format(Message, FormatConfig)),
167167
case rabbit_basic:publish(LogExch, RoutingKey, AmqpMsg, Body) of
168-
{ok, _DeliveredQPids} -> ok;
169-
{error, not_found} -> ok
168+
ok -> ok;
169+
{error, not_found} -> ok
170170
end,
171171
{ok, State};
172172
false ->

src/lqueue.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,17 @@ is_empty(_) -> false.
5252

5353
in(V, {L, Q}) -> {L+1, ?QUEUE:in(V, Q)}.
5454

55-
-spec in_r(value(), ?MODULE()) -> ?MODULE().
55+
-spec in_r(value(), ?MODULE(T)) -> ?MODULE(T).
5656

5757
in_r(V, {L, Q}) -> {L+1, ?QUEUE:in_r(V, Q)}.
5858

59-
-spec out(?MODULE(T)) -> {result(T), ?MODULE()}.
59+
-spec out(?MODULE(T)) -> {result(T), ?MODULE(T)}.
6060

6161
out({0, _Q} = Q) -> {empty, Q};
6262
out({L, Q}) -> {Result, Q1} = ?QUEUE:out(Q),
6363
{Result, {L-1, Q1}}.
6464

65-
-spec out_r(?MODULE(T)) -> {result(T), ?MODULE()}.
65+
-spec out_r(?MODULE(T)) -> {result(T), ?MODULE(T)}.
6666

6767
out_r({0, _Q} = Q) -> {empty, Q};
6868
out_r({L, Q}) -> {Result, Q1} = ?QUEUE:out_r(Q),

src/rabbit_amqqueue.erl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
-type qpids() :: [pid()].
7878
-type qlen() :: rabbit_types:ok(non_neg_integer()).
7979
-type qfun(A) :: fun ((amqqueue:amqqueue()) -> A | no_return()).
80-
-type qmsg() :: {name(), pid(), msg_id(), boolean(), rabbit_types:message()}.
80+
-type qmsg() :: {name(), pid() | {atom(), pid()}, msg_id(), boolean(), rabbit_types:message()}.
8181
-type msg_id() :: non_neg_integer().
8282
-type ok_or_errors() ::
8383
'ok' | {'error', [{'error' | 'exit' | 'throw', any()}]}.
@@ -244,7 +244,9 @@ recover_durable_queues(QueuesAndRecoveryTerms) ->
244244
rabbit_framing:amqp_table(),
245245
rabbit_types:maybe(pid()),
246246
rabbit_types:username()) ->
247-
{'new' | 'existing' | 'absent' | 'owner_died', amqqueue:amqqueue()} |
247+
{'new' | 'existing' | 'owner_died', amqqueue:amqqueue()} |
248+
{'new', amqqueue:amqqueue(), rabbit_fifo_client:state()} |
249+
{'absent', amqqueue:amqqueue(), absent_reason()} |
248250
rabbit_types:channel_exit().
249251

250252
declare(QueueName, Durable, AutoDelete, Args, Owner, ActingUser) ->
@@ -1038,6 +1040,7 @@ notify_policy_changed(Q) when ?amqqueue_is_quorum(Q) ->
10381040

10391041
-spec consumers(amqqueue:amqqueue()) ->
10401042
[{pid(), rabbit_types:ctag(), boolean(), non_neg_integer(),
1043+
boolean(), atom(),
10411044
rabbit_framing:amqp_table(), rabbit_types:username()}].
10421045

10431046
consumers(Q) when ?amqqueue_is_classic(Q) ->

src/rabbit_amqqueue_process.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1195,7 +1195,7 @@ prioritise_cast(Msg, _Len, State) ->
11951195
%% will be rate limited by how fast consumers receive messages -
11961196
%% i.e. by notify_sent. We prioritise ack and resume to discourage
11971197
%% starvation caused by prioritising notify_sent. We don't vary their
1198-
%% prioritiy since acks should stay in order (some parts of the queue
1198+
%% priority since acks should stay in order (some parts of the queue
11991199
%% stack are optimised for that) and to make things easier to reason
12001200
%% about. Finally, we prioritise ack over resume since it should
12011201
%% always reduce memory use.
@@ -1592,10 +1592,10 @@ handle_cast({force_event_refresh, Ref},
15921592
[emit_consumer_created(
15931593
Ch, CTag, false, AckRequired, QName, Prefetch,
15941594
Args, Ref, ActingUser) ||
1595-
{Ch, CTag, AckRequired, Prefetch, Args, ActingUser}
1595+
{Ch, CTag, AckRequired, Prefetch, _, _, Args, ActingUser}
15961596
<- AllConsumers];
15971597
{Ch, CTag} ->
1598-
[{Ch, CTag, AckRequired, Prefetch, Args, ActingUser}] = AllConsumers,
1598+
[{Ch, CTag, AckRequired, Prefetch, _, _, Args, ActingUser}] = AllConsumers,
15991599
emit_consumer_created(
16001600
Ch, CTag, true, AckRequired, QName, Prefetch, Args, Ref, ActingUser)
16011601
end,

src/rabbit_backing_queue.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158

159159
%% Drop messages from the head of the queue while the supplied
160160
%% predicate on message properties returns true. Returns the first
161-
%% message properties for which the predictate returned false, or
161+
%% message properties for which the predicate returned false, or
162162
%% 'undefined' if the whole backing queue was traversed w/o the
163163
%% predicate ever returning false.
164164
-callback dropwhile(msg_pred(), state())
@@ -259,7 +259,7 @@
259259

260260
-callback set_queue_mode(queue_mode(), state()) -> state().
261261

262-
-callback zip_msgs_and_acks(delivered_publish(),
262+
-callback zip_msgs_and_acks([delivered_publish()],
263263
[ack()], Acc, state())
264264
-> Acc.
265265

src/rabbit_basic.erl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
-type properties_input() ::
3131
rabbit_framing:amqp_property_record() | [{atom(), any()}].
3232
-type publish_result() ::
33-
{ok, [pid()]} | rabbit_types:error('not_found').
33+
ok | rabbit_types:error('not_found').
3434
-type header() :: any().
3535
-type headers() :: rabbit_framing:amqp_table() | 'undefined'.
3636

@@ -76,8 +76,7 @@ publish(Delivery = #delivery{
7676

7777
publish(X, Delivery) ->
7878
Qs = rabbit_amqqueue:lookup(rabbit_exchange:route(X, Delivery)),
79-
DeliveredQPids = rabbit_amqqueue:deliver(Qs, Delivery),
80-
{ok, DeliveredQPids}.
79+
rabbit_amqqueue:deliver(Qs, Delivery).
8180

8281
-spec delivery
8382
(boolean(), boolean(), rabbit_types:message(), undefined | integer()) ->

src/rabbit_channel.erl

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -869,9 +869,7 @@ send(Command, #ch{writer_pid = WriterPid}) ->
869869
ok = rabbit_writer:send_command(WriterPid, Command).
870870

871871
format_soft_error(#amqp_error{name = N, explanation = E, method = M}) ->
872-
io_lib:format("operation ~s caused a channel exception ~s: ~ts", [M, N, E]);
873-
format_soft_error(Reason) ->
874-
Reason.
872+
io_lib:format("operation ~s caused a channel exception ~s: ~ts", [M, N, E]).
875873

876874
handle_exception(Reason, State = #ch{protocol = Protocol,
877875
channel = Channel,
@@ -1455,7 +1453,7 @@ handle_method(#'basic.qos'{prefetch_size = Size}, _, _State) when Size /= 0 ->
14551453
handle_method(#'basic.qos'{global = false,
14561454
prefetch_count = PrefetchCount},
14571455
_, State = #ch{limiter = Limiter}) ->
1458-
%% Ensures that if default was set, it's overriden
1456+
%% Ensures that if default was set, it's overridden
14591457
Limiter1 = rabbit_limiter:unlimit_prefetch(Limiter),
14601458
{reply, #'basic.qos_ok'{}, State#ch{consumer_prefetch = PrefetchCount,
14611459
limiter = Limiter1}};
@@ -2145,19 +2143,14 @@ send_confirms_and_nacks(State) ->
21452143

21462144
send_nacks([], _, State) ->
21472145
State;
2148-
send_nacks(_Rs, _, State = #ch{state = closing,
2149-
tx = none}) -> %% optimisation
2146+
send_nacks(_Rs, _, State = #ch{state = closing}) -> %% optimisation
21502147
State;
2151-
send_nacks(Rs, Cs, State = #ch{tx = none}) ->
2148+
send_nacks(Rs, Cs, State) ->
21522149
coalesce_and_send(Rs, Cs,
21532150
fun(MsgSeqNo, Multiple) ->
21542151
#'basic.nack'{delivery_tag = MsgSeqNo,
21552152
multiple = Multiple}
2156-
end, State);
2157-
send_nacks(_MXs, _, State = #ch{state = closing}) -> %% optimisation
2158-
State#ch{tx = failed};
2159-
send_nacks(_, _, State) ->
2160-
maybe_complete_tx(State#ch{tx = failed}).
2153+
end, State).
21612154

21622155
send_confirms([], _, State) ->
21632156
State;

src/rabbit_feature_flags.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,7 @@ does_node_support(Node, FeatureNames, Timeout) ->
14111411
%% If rabbit_feature_flags:is_supported_locally/1 is undefined
14121412
%% on the remote node, we consider it to be a 3.7.x node.
14131413
%%
1414-
%% Theoritically, it could be an older version (3.6.x and
1414+
%% Theoretically, it could be an older version (3.6.x and
14151415
%% older). But the RabbitMQ version consistency check
14161416
%% (rabbit_misc:version_minor_equivalent/2) called from
14171417
%% rabbit_mnesia:check_rabbit_consistency/2 already blocked

src/rabbit_ff_registry.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ is_registry_written_to_disk() ->
148148
always_return_true() ->
149149
%% This function is here to trick Dialyzer. We want some functions
150150
%% in this initial on-disk registry to always return `true` or
151-
%% `false`. However the generated regsitry will return actual
151+
%% `false`. However the generated registry will return actual
152152
%% booleans. The `-spec()` correctly advertises a return type of
153153
%% `boolean()`. But in the meantime, Dialyzer only knows about this
154154
%% copy which, without the trick below, would always return either
@@ -161,7 +161,7 @@ always_return_true() ->
161161
%% That's why this function makes a call which we know the result,
162162
%% but not Dialyzer, to "create" that hard-coded `true` return
163163
%% value.
164-
rand:uniform(1) > 0.
164+
erlang:get({?MODULE, always_undefined}) =:= undefined.
165165

166166
always_return_false() ->
167167
not always_return_true().

0 commit comments

Comments
 (0)