diff options
| author | Luke Bakken <luke@bakken.io> | 2019-01-09 14:27:53 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-09 14:27:53 -0800 |
| commit | b204aaac6e787a1b28ceaa60ba10e07ab2635a72 (patch) | |
| tree | debb3229917d3dca651316a3495b1649f0ddb91a /src | |
| parent | c8d0430630c4c5c3b22f02f5c469f0217a8241b5 (diff) | |
| parent | a3f0b3f8c3cc3a0fce411513c32be441c89d0f3d (diff) | |
| download | rabbitmq-server-git-b204aaac6e787a1b28ceaa60ba10e07ab2635a72.tar.gz | |
Merge pull request #1821 from rabbitmq/lrb-update-sysmon_handler
Update to sysmon_handler 1.1.0
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 26 | ||||
| -rw-r--r-- | src/rabbit_sysmon_handler.erl | 5 |
2 files changed, 30 insertions, 1 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index 2a37d0ba75..980b629a19 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -523,6 +523,7 @@ start_apps(Apps) -> start_apps(Apps, RestartTypes) -> app_utils:load_applications(Apps), + ensure_sysmon_handler_app_config(), ConfigEntryDecoder = case application:get_env(rabbit, config_entry_decoder) of undefined -> []; @@ -553,7 +554,6 @@ start_apps(Apps, RestartTypes) -> PassPhrase }, decrypt_config(Apps, Algo), - OrderedApps = app_utils:app_dependency_order(Apps, false), case lists:member(rabbit, Apps) of false -> rabbit_boot_steps:run_boot_steps(Apps); %% plugin activation @@ -563,6 +563,30 @@ start_apps(Apps, RestartTypes) -> handle_app_error(could_not_start), RestartTypes). +%% rabbitmq/rabbitmq-server#952 +%% This function is to be called after configuration has been optionally generated +%% and the sysmon_handler application loaded, but not started. It will ensure that +%% sane defaults are used for configuration settings that haven't been set by the +%% user +ensure_sysmon_handler_app_config() -> + Defaults = [ + {process_limit, 100}, + {port_limit, 100}, + {gc_ms_limit, 0}, + {schedule_ms_limit, 0}, + {heap_word_limit, 10485760}, + {busy_port, false}, + {busy_dist_port, true} + ], + lists:foreach(fun({K, V}) -> + case application:get_env(sysmon_handler, K) of + undefined -> + application:set_env(sysmon_handler, K, V); + _ -> + ok + end + end, Defaults). + %% This function retrieves the correct IoDevice for requesting %% input. The problem with using the default IoDevice is that %% the Erlang shell prevents us from getting the input. diff --git a/src/rabbit_sysmon_handler.erl b/src/rabbit_sysmon_handler.erl index 4e878f618d..9b778bcfc3 100644 --- a/src/rabbit_sysmon_handler.erl +++ b/src/rabbit_sysmon_handler.erl @@ -91,6 +91,11 @@ handle_event({monitor, PidOrPort, Type, Info}, State=#state{timer_ref=TimerRef}) {Fmt, Args} = format_pretty_proc_or_port_info(PidOrPort), rabbit_log:warning("~p ~w ~w " ++ Fmt ++ " ~w", [?MODULE, Type, PidOrPort] ++ Args ++ [Info]), {ok, State#state{timer_ref=NewTimerRef}}; +handle_event({suppressed, Type, Info}, State=#state{timer_ref=TimerRef}) -> + %% Reset the inactivity timeout + NewTimerRef = reset_timer(TimerRef), + rabbit_log:debug("~p encountered a suppressed event of type ~w: ~w", [?MODULE, Type, Info]), + {ok, State#state{timer_ref=NewTimerRef}}; handle_event(Event, State=#state{timer_ref=TimerRef}) -> NewTimerRef = reset_timer(TimerRef), rabbit_log:warning("~p unhandled event: ~p", [?MODULE, Event]), |
