Skip to content

Commit 4f35fdb

Browse files
committed
Speed up stop_app
I noticed that `stop_app` would take over 5 seconds on an empty node which is strange. I found this gap in the logs: ``` 2024-04-18 10:49:04.646450+09:00 [info] <0.599.0> Management plugin: to stop collect_statistics. 2024-04-18 10:49:09.647652+09:00 [debug] <0.247.0> Set stop reason to: normal ``` No point waiting for that stats to stop being emitted when we stop the node completely. It was added in 0e640da5 to ensure the stats stop when the management_agent gets disabled
1 parent 0175c80 commit 4f35fdb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

deps/rabbitmq_management_agent/src/rabbit_mgmt_db_handler.erl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ handle_event(_, State) ->
9292
handle_info(_Info, State) ->
9393
{ok, State}.
9494

95+
terminate(stop, _State) ->
96+
%% if the node is stopping, we don't want to wait
97+
%% 5 seconds for the statistics to get disabled
98+
ok;
9599
terminate(_Arg, _State) ->
96100
ensure_statistics_disabled(),
97101
ok.

0 commit comments

Comments
 (0)