Skip to content

Commit 0e3adc5

Browse files
Merge pull request #3409 from rabbitmq/lh-increase-queue-shutdown-timeout
Increase classic queue shutdown timeout (cherry picked from commit 5fb118e)
1 parent fe34290 commit 0e3adc5

File tree

4 files changed

+23
-8
lines changed

4 files changed

+23
-8
lines changed

deps/rabbit/src/rabbit_amqqueue_sup.erl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ start_link(Q, StartMode) ->
2424
Marker = spawn_link(fun() -> receive stop -> ok end end),
2525
ChildSpec = {rabbit_amqqueue,
2626
{rabbit_prequeue, start_link, [Q, StartMode, Marker]},
27-
intrinsic, ?WORKER_WAIT, worker, [rabbit_amqqueue_process,
28-
rabbit_mirror_queue_slave]},
27+
intrinsic, ?CLASSIC_QUEUE_WORKER_WAIT, worker,
28+
[rabbit_amqqueue_process, rabbit_mirror_queue_slave]},
2929
{ok, SupPid} = supervisor2:start_link(?MODULE, []),
3030
{ok, QPid} = supervisor2:start_child(SupPid, ChildSpec),
3131
unlink(Marker),

deps/rabbit_common/include/rabbit.hrl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,9 +225,11 @@
225225
-define(SUPERVISOR_WAIT,
226226
rabbit_misc:get_env(rabbit, supervisor_shutdown_timeout, infinity)).
227227
-define(WORKER_WAIT,
228-
rabbit_misc:get_env(rabbit, worker_shutdown_timeout, 30000)).
228+
rabbit_misc:get_env(rabbit, worker_shutdown_timeout, 300000)).
229229
-define(MSG_STORE_WORKER_WAIT,
230230
rabbit_misc:get_env(rabbit, msg_store_shutdown_timeout, 600000)).
231+
-define(CLASSIC_QUEUE_WORKER_WAIT,
232+
rabbit_misc:get_env(rabbit, classic_queue_shutdown_timeout, 600000)).
231233

232234
-define(HIBERNATE_AFTER_MIN, 1000).
233235
-define(DESIRED_HIBERNATE, 10000).

deps/rabbitmq_federation/test/queue_SUITE.erl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
-import(rabbit_federation_test_util,
1717
[wait_for_federation/2, expect/3, expect/4,
18-
set_upstream/4, set_upstream/5, clear_upstream/3, set_policy/5, clear_policy/3,
18+
set_upstream/4, set_upstream/5, clear_upstream/3, clear_upstream_set/3,
19+
set_policy/5, clear_policy/3,
1920
set_policy_pattern/5, set_policy_upstream/5, q/2, with_ch/3,
2021
maybe_declare_queue/3, delete_queue/2,
2122
federation_links_in_vhost/3]).
@@ -35,7 +36,7 @@ groups() ->
3536
multiple_upstreams,
3637
multiple_upstreams_pattern,
3738
multiple_downstreams,
38-
bidirectional,
39+
message_flow,
3940
dynamic_reconfiguration,
4041
federate_unfederate,
4142
dynamic_plugin_stop_start
@@ -249,7 +250,7 @@ multiple_downstreams(Config) ->
249250
expect_federation(Ch, <<"upstream">>, <<"fed.downstream2">>, ?EXPECT_FEDERATION_TIMEOUT)
250251
end, upstream_downstream(Config) ++ [q(<<"fed.downstream2">>, Args)]).
251252

252-
bidirectional(Config) ->
253+
message_flow(Config) ->
253254
%% TODO: specifc source / target here
254255
Args = ?config(source_queue_args, Config),
255256
with_ch(Config,
@@ -267,7 +268,13 @@ bidirectional(Config) ->
267268
[publish(Ch, <<>>, <<"two">>, <<"bulk">>) || _ <- Seq],
268269
expect(Ch, <<"two">>, repeat(100, <<"bulk">>)),
269270
expect_empty(Ch, <<"one">>),
270-
expect_empty(Ch, <<"two">>)
271+
expect_empty(Ch, <<"two">>),
272+
%% We clear the federation configuration to avoid a race condition
273+
%% when deleting the queues in quorum mode. The federation link
274+
%% would restart and lead to a state where nothing happened for
275+
%% minutes.
276+
clear_upstream_set(Config, 0, <<"one">>),
277+
clear_upstream_set(Config, 0, <<"two">>)
271278
end, [q(<<"one">>, Args),
272279
q(<<"two">>, Args)]).
273280

release-notes/3.8.23.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ consistent release schedule.
4545

4646
#### Bug Fixes
4747

48-
* TLS information delivered in [Proxy protocol](https://www.rabbitmq.com/networking.html#proxy-protocol) header is now attached to connection metrics as if it was provided by a non-proxying client.
48+
* TLS information delivered in [Proxy protocol](https://www.rabbitmq.com/networking.html#proxy-protocol) header is now attached to connection metrics as if it was provided by a non-proxying client.
4949

5050
GitHub issue: [#3175](https://github.com/rabbitmq/rabbitmq-server/pull/3175) contributed by @prefiks, sponsored by CloudAMQP
5151

52+
* Classic queue shutdown now uses a much higher timeout (up to 10 minutes instead of 30 seconds).
53+
54+
In environments with many queues (especially mirrored queues) and many consumers this means that
55+
the chance of queue indices rebuilding after node restart is now substantially lower.
56+
57+
GitHub issue: [#3409](https://github.com/rabbitmq/rabbitmq-server/pull/3409)
5258

5359

5460
## Dependency Upgrades

0 commit comments

Comments
 (0)