diff options
author | Siri Hansen <[email protected]> | 2018-06-15 11:16:00 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2018-06-15 11:16:00 +0200 |
commit | 1bf30863a847aec45799361d39ccd440346b2d6a (patch) | |
tree | eaf29208480ef4ec671ee429f6ad171013c3f2f7 /lib/kernel/src | |
parent | 3c2ab242ecf10cc49e81e053514634a5fa10af1a (diff) | |
parent | 5e23103186cb71c64f7f2fa28cbfd8c62d7ee21b (diff) | |
download | otp-1bf30863a847aec45799361d39ccd440346b2d6a.tar.gz otp-1bf30863a847aec45799361d39ccd440346b2d6a.tar.bz2 otp-1bf30863a847aec45799361d39ccd440346b2d6a.zip |
Merge branch 'siri/logger-fix'
* siri/logger-fix:
[logger] Update documentation
[logger] Adjust priority settings in test
[logger] Unregister handler names before terminating
[logger] Stress overload_kill tests in disk_log handler
Diffstat (limited to 'lib/kernel/src')
-rw-r--r-- | lib/kernel/src/logger_disk_log_h.erl | 6 | ||||
-rw-r--r-- | lib/kernel/src/logger_std_h.erl | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/kernel/src/logger_disk_log_h.erl b/lib/kernel/src/logger_disk_log_h.erl index f08621c9c5..cf8ea658e3 100644 --- a/lib/kernel/src/logger_disk_log_h.erl +++ b/lib/kernel/src/logger_disk_log_h.erl @@ -249,7 +249,8 @@ init([Name, max_no_files:=MNF}}, State = #{dl_sync_int := DLSyncInt}]) -> - register(?name_to_reg_name(?MODULE,Name), self()), + RegName = ?name_to_reg_name(?MODULE,Name), + register(RegName, self()), process_flag(trap_exit, true), process_flag(message_queue_data, off_heap), @@ -296,10 +297,12 @@ init([Name, enter_loop(Config1, State1) catch _:Error -> + unregister(RegName), logger_h_common:error_notify({open_disk_log,Name,Error}), proc_lib:init_ack(Error) end; Error -> + unregister(RegName), logger_h_common:error_notify({open_disk_log,Name,Error}), proc_lib:init_ack(Error) end. @@ -426,6 +429,7 @@ terminate(Reason, State = #{id := Name}) -> _ = logger_h_common:cancel_timer(maps:get(rep_sync_tref, State, undefined)), _ = close_disk_log(Name, normal), + unregister(?name_to_reg_name(?MODULE, Name)), logger_h_common:stop_or_restart(Name, Reason, State). code_change(_OldVsn, State, _Extra) -> diff --git a/lib/kernel/src/logger_std_h.erl b/lib/kernel/src/logger_std_h.erl index a03e1ffc2a..2a37076dda 100644 --- a/lib/kernel/src/logger_std_h.erl +++ b/lib/kernel/src/logger_std_h.erl @@ -229,7 +229,8 @@ log(LogEvent, Config = #{id := Name, init([Name, Config = #{config := HConfig}, State0 = #{type := Type, file_ctrl_sync_int := FileCtrlSyncInt}]) -> - register(?name_to_reg_name(?MODULE,Name), self()), + RegName = ?name_to_reg_name(?MODULE,Name), + register(RegName, self()), process_flag(trap_exit, true), process_flag(message_queue_data, off_heap), @@ -261,10 +262,12 @@ init([Name, Config = #{config := HConfig}, enter_loop(Config1, State1) catch _:Error -> + unregister(RegName), logger_h_common:error_notify({init_handler,Name,Error}), proc_lib:init_ack(Error) end; Error -> + unregister(RegName), logger_h_common:error_notify({init_handler,Name,Error}), proc_lib:init_ack(Error) end. @@ -415,6 +418,7 @@ terminate(Reason, State = #{id:=Name, file_ctrl_pid:=FWPid, false -> ok end, + unregister(?name_to_reg_name(?MODULE, Name)), logger_h_common:stop_or_restart(Name, Reason, State). code_change(_OldVsn, State, _Extra) -> |