Skip to content

Commit 5fb118e

Browse files
Merge pull request #3409 from rabbitmq/lh-increase-queue-shutdown-timeout
Increase classic queue shutdown timeout
2 parents 92a6d0f + dfe0f4b commit 5fb118e

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-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
@@ -239,7 +240,7 @@ multiple_downstreams(Config) ->
239240
expect_federation(Ch, <<"upstream">>, <<"fed.downstream2">>, ?EXPECT_FEDERATION_TIMEOUT)
240241
end, upstream_downstream(Config) ++ [q(<<"fed.downstream2">>, Args)]).
241242

242-
bidirectional(Config) ->
243+
message_flow(Config) ->
243244
%% TODO: specifc source / target here
244245
Args = ?config(source_queue_args, Config),
245246
with_ch(Config,
@@ -257,7 +258,13 @@ bidirectional(Config) ->
257258
[publish(Ch, <<>>, <<"two">>, <<"bulk">>) || _ <- Seq],
258259
expect(Ch, <<"two">>, repeat(100, <<"bulk">>)),
259260
expect_empty(Ch, <<"one">>),
260-
expect_empty(Ch, <<"two">>)
261+
expect_empty(Ch, <<"two">>),
262+
%% We clear the federation configuration to avoid a race condition
263+
%% when deleting the queues in quorum mode. The federation link
264+
%% would restart and lead to a state where nothing happened for
265+
%% minutes.
266+
clear_upstream_set(Config, 0, <<"one">>),
267+
clear_upstream_set(Config, 0, <<"two">>)
261268
end, [q(<<"one">>, Args),
262269
q(<<"two">>, Args)]).
263270

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

release-notes/3.9.6.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ Contributors are encouraged to update them together with their changes. This hel
4545

4646
GitHub issue: [#3340](https://github.com/rabbitmq/rabbitmq-server/pull/3340)
4747

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

4956
### Management Plugin
5057

0 commit comments

Comments
 (0)