Skip to content

Commit 015be93

Browse files
committed
Speed up shovel start and cleanup
The filtering was incorrect, so we ended up trying to delete all existing shovels. Running shovels would reject the attempt, so things generally worked as expected, but this redundant work was quite costly. In a test with 1000 shovels, this change speeds up a definition import from a few minutes to a few seconds. Fixes #9714 Fixes #8364
1 parent 537fcca commit 015be93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

deps/rabbitmq_shovel/src/rabbit_shovel_dyn_worker_sup_sup.erl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ stop_child({VHost, ShovelName} = Name) ->
8484

8585
cleanup_specs() ->
8686
SpecsSet = sets:from_list([element(2, element(1, S)) || S <- mirrored_supervisor:which_children(?SUPERVISOR)]),
87-
ParamsSet = sets:from_list(rabbit_runtime_parameters:list_component(<<"shovel">>)),
87+
ParamsSet = sets:from_list([ {proplists:get_value(vhost, S), proplists:get_value(name, S)}
88+
|| S <- rabbit_runtime_parameters:list_component(<<"shovel">>) ]),
8889
F = fun(Name, ok) ->
8990
_ = mirrored_supervisor:delete_child(?SUPERVISOR, id(Name)),
9091
ok

0 commit comments

Comments
 (0)